Van1310
378
18
Laravel

Trying to get property of non-object

Posted 4 months ago by Van1310

Blade file

@foreach ($information as $informations)

{{$informations->followups->description}}

{{$informations->followups->followupdate}}

@endforeach

Controller file

    $information=Registration::where('id','=',$id)->get();

return view('view',compact('information'));   

 

Model followup

public function registrations()

{

    return $this->hasMany('App\Registration');

}

Registration Model

public function followups()

{

   return $this->belongsTo('App\Followup','student_id');

}

Please sign in or create an account to participate in this conversation.