定制 mirhamzah/laravel-interactive-make 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mirhamzah/laravel-interactive-make

Composer 安装命令:

composer require mirhamzah/laravel-interactive-make

包简介

Interactive make commands for making Model and Migration with fields

README 文档

README

Interactive make commands for making Model and Migration with fields

composer require mirhamzah/laravel-interactive-make:dev-master

Then

php artisan make:imodel ModelName

Or

php artisan make:imodel ModelName -m

for making a new migration as well, just like with normal make:model command.

Screenshot

You can add relationships to existing model files using the command

#php artisan make:relationship [SourceModel] [RelationshipType] [TargetModel]

php artisan make:relationship User HasMany Acrticle

The above command will add following code to User model file:

use Illuminate\Database\Eloquent\Relations\HasMany;

public function articles(): ?HasMany
{
    return $this->hasMany(Article::class);
}
php artisan make:iview ModelName

The make:iview command generates view components for the specified model. It creates two files, create.jsx and edit.jsx, which are React components designed for creating and editing instances of the model. These components are automatically populated with form fields based on the $fillable and $casts properties defined in the model class, ensuring consistency between the model and its associated views.

统计信息

  • 总下载量: 9
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2023-08-02