I want to create a model in a custom path. If i write the php artisan command like the following it will create model inside app.
php artisan make:model core
But i want to create the model file inside the custom made Models folder. How can i do it ?
In the latest version of Laravel, running the command php artisan make:model MyModel will create the model inside the App\Models directory.
You can use the artisan make:model command line helper to generate new models for your application. To create a new Eloquent model for your links table, run: docker-compose exec app php artisan make:model Link.
Navigate to your project folder and run the following commands to create new: Model: php artisan make:model YourModelName. Controller: php artisan make:controller YourControllerName. Migration: php artisan make:migration create_users_table.
Just define the path where you want to create model.
php artisan make:model <directory_name>/<model_name>
e.g.
php artisan make:model Models/core
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With