Sunday, March 5, 2017

Laravel 5.4 - Artisan make:controller XxxController --resource --model=Xxx not identifying Model driectory genereted by reliese/laravel

I have a database that already is in use when I started a new API in Laravel 5.4.

For this reason, instead of use Migrations, I have used reliese/laravel to generate the Models from my database.

The point is that reliese have created models inside app/Models/. So I have a table that was converted into app/Models/City.php for example.

So when I try to create a Controller using Artisan like this:

php artisan make:controller CityController --resource --model=City

I get this error:

A App\City model does not exist. Do you want to generate it? (yes/no) [yes]:

Because Artisan is searching the Model City.php inside app/ folder.

Is there a way to make Artisan to point to app/Models instead?



via zwitterion

Advertisement