I needed to use the FQN of the model for this to work. Solved.
davidxd33 said:
I needed to use the FQN of the model for this to work. Solved.
Have an example of working code?
mottihoresh said:
davidxd33 said:
I needed to use the FQN of the model for this to work. Solved.
Have an example of working code?
I imagine he changed:
return $this->belongsTo('User');
to:
return $this->belongsTo('App\User');
At least that's what I had to do. Is this the proper way to do this?
Any word on this? Only way my models work is if I prepend the app name before the model name
return $this->belongsTo('AppName\Company');
I'm having the same problem.. I already have my namespace App; declared on top of the Model. I heard about using the composer dump-autoload will fix the problem, but it doesn't work for mine. Adding the extra namespace for every line of code works but it looks little bit ugly.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community