Merhaba iyi forumlar,
photos tablom var user modeline bağlı.
User model;
public function photo()
{
return $this->morphOne('App\Photo', 'photoable');
}
UserController;
public function show()
{
$user = User::with('photo')->where('status', 'active');
$user->where('id', Auth::id())->first();
return view('users.profile', compact('user'));
}
photo tablosunu çağırıyorum ama gelmeden önce status durumunu active ise çekmek istiyorum fakat user tablosunda status arıyor.
Hata Mesajı;
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'status' in 'where clause' (SQL: select * from
userswhere
status= active and
id= 21 limit 1)