add the to the function in the model
eg : you can't access $user->photo then create a function
inside user model called getImage() then inside the function write
return $this->attributes['photo'];
then call the $user->getImage() in the controller,
everything will work fine