Hello, In order to use your Model class in controller you need to add a namespace: use App\Post; - or something like that ( depends on your structure ) :)
Ok so, I have to know that.
If I want to use a class in a controller I must include it: "use App\MyModel" that is better than creating an allias and populating your config\app.php file, right?
Alias should be only created for specific classes/models. If you will add all models to alias - you will face loading problems. I have about 70 models created in total and if I will add all of them to my app.php - i will lose performance :)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community