Skip to content

Instantly share code, notes, and snippets.

@talha08
Created March 27, 2016 16:32
Show Gist options
  • Save talha08/7ec70ced426b424151e5 to your computer and use it in GitHub Desktop.
Save talha08/7ec70ced426b424151e5 to your computer and use it in GitHub Desktop.
Route::get('time',function(){
$created = new Carbon\Carbon(User::where('id',1)->first()->created_at);
$now = Carbon\Carbon::now();
return $difference = ($created->diff($now)->days < 1) ? 'today' : $created->diffForHumans($now);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment