How to create model into package by artisan?



  • Artisan is working on root level. Please share command to create model under packages. Or other method to create it.



  • Hi _developer_12.

    Model artisan command will not directly work inside your package folder.
    What you can do is:

    On the root level. Create your model with the artisan command (php artisan make:model YourModel).
    Now copy your model file into (package folder -> src -> Models ).
    Now change the namespace manually by editing the file.

    Thanks and Regards
    Aayush Bhatt


Log in to reply