Support the ongoing development of Laravel.io →
Database Eloquent

In Laravel 4, I could go:

Show::all();

But in Laravel 5, I have to go:

\Show::all();

or

\App\Models\Show::all();

(I prefer to keep all of my models in a Models folder inside App.

Is there a way around this? The Laravel 4 example above is cleaner.

Last updated 3 years ago.
0

So if I understand correctly, at the top of the controller, I'll need to do the following for each model:

use \App\Models\Show;

Is that right?

0

Or a namespace

0

Sign in to participate in this thread!

Eventy

Your banner here too?

jerauf jerauf Joined 16 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.