In Laravel 4 I am having trouble calling a Related model when the Parent model is Soft Deleted...
In my Controller I have this which gets a Campaign record....
$campaign = Campaign::find($id);
In my View for this controller method, I call a related model like this...
echo $campaign->user->profile->full_name;
User
is related to Camapign
and Profile
is related to User
My problem is, if a user is Soft Deleted
, when I call echo $campaign->user->profile->full_name;
I get...
ErrorException
Trying to get property of non-object (View: app/views/campaign/mapView.blade.php)
What I would like to do is instead show an error message that this users campaign is disabled/deleted since the User is soft deleted.