I'm having a tough time migrating the Laravel 4.2
files to Laravel 5.1
. I know it works with a lot of namespacing
. So probably most of my errors would be because of the namespace
issues. But I'm a bit new to namespace
things. So I've some problems. I hope this would also benefit to some other users as well.
Composer.json
file :
"classmap": [
"database",
"app/Http/Controllers",
"app/Models"
],
- According to the Laravel 5.1 updgrade documentation, I've creates a
App\Models
structure for theModels
.
I'm getting this error related to Models
. Where Backers.php
and User
are the models
. What namespace
should I provide to avoid this?
FatalErrorException in Backers.php line 16: Class 'User' not found
I've used
User::find($id)
in someViews
andControllers
. Instead of always calling\App\User::find($id)
, is there any other way I could approach this problem?displayLesson
is aroute
name and sometimes I'm getting an error like
App\Http\Controllers\displayLesson not found.
How can I approach these problems?