Calculate difference between two dates using Carbon and Blade

 <p>I want to display the difference of time in posting related to current time such as you have posted this blog 15 min ago</p> 

Answer
 

In controller:

 

pubic function function_name()

{

$varible = DB::table(‘table_name’)->paginate(number_of_records_in_one_page);

}

In your blade:

{{$varible->links()}}


 
In controller:

pubic function function_name()

{

$varible = DB::table(‘table_name’)->paginate(number_of_records_in_one_page);

}

In your blade:

{{$varible->links()}}

 
pubic function function_name() {
   $varible = DB::table(‘table_name’)->paginate(number_of_records_in_one_page);
   return view('example_view',['varible'=>$varible])
}