Reputation: 199
I'm struggling to use models and classes in Laravel 5 'FatalErrorException' class "name" not found.
Take the User class as standard under the App/ folder, it will only work as $user = App\User::where... or I can go 'use App/User'... Rather than just User::where. How can I get around this back to L4 where it just worked?
Secondly I came to Session::get standard Laravel Class, same error class 'Session' not found.
Unable to find a solution after 4 hours I'm resorting to asking the question... Thanks.
Upvotes: 0
Views: 2087
Reputation: 5443
for laravel 5 you need to use namaspace if you want to use session you need to use that line in top of the class
use Session;
Upvotes: 1