It still works.
Is $blogs a single model or is it a collection of models?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
After working with Laravel 5.6.x i have some errors with date to string. In older versions i used it for date to string.
{{ $blogs->created_at->format('Y-m-d , G:i:s') }}
But after laravel 5.6 it doesn't work. How can i fix it? Thanks!
You are getting blogs by DB facade, which returns a collection of /stdClass instances and of course $blog->created_at is just a string, so you can't call format method on it. You should parse it to Carbon, or get your blogs using Blog model.
Please or to participate in this conversation.