I'm working with Laravel and I want to display the created_at timestamp formatted of course, but only where id = 1, so the latest one.
public function statistics(){
$first = DB::table('articles')
->select('created_at')
->where('id', '=', 1)
->get();
return view('pages.statistics')->with('first', $first);;
}
blade:
{{ $first}}
I want to have a formatted date, but when I use the date function it automatically sets the date to 01.01.1970
This is what I get:
[{"created_at":"2018-08-23 11:45:34"}]
Should I work with Carbon and if yes, how?