vandan
195
18
Laravel

Trying to get property of non-object

Posted 6 days ago by vandan

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.

Reply to

Use Markdown with GitHub-flavored code blocks.