I am not sure, I haven't seen anyone doing it, in Profile class, why you pass same parameter twice in photo method? user_id. SHould be passed one, right?
public function photo()
{
return $this->hasMany('Photo','user_id','user_id');
}
and I am not sure, but I prefer, maybe Try passing second parameter in profile()
public function profile()
{
return $this->hasOne('Profile','user_id');
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community