How do I instruct artisan to save model to specific directory?

Create a Models directory or whatever your want to named it, put it in inside app directory. The Directory structure should look like

laravel-project
     /app
        /Console
        /Events
        /Exceptions
        /Http
        /Jobs
        /Listeners
        /Provider
       /Models

Then You just need to type artisan command for creating models inside Models directory

php artisan make:model Models/ModelName 

After Creating Models your namespace inside model classes will be

namespace app-name\Models\ModelName

You can access this model in inside your controller

use app-name\Models\ModelName

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)