Looking to hire Laravel developers? Try LaraJobs

laravel-interactive-make maintained by mirhamzah

Description
Interactive make commands for making Model and Migration with fields
Last update
2025/08/08 18:37 (dev-master)
Links
Downloads
9
Tags

Comments
comments powered by Disqus

laravel-interactive-make

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.