Level 102
Either use a mutator on the model or use an api resource. I would use a resource
https://laravel.com/docs/9.x/eloquent-resources#main-content
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Usually laravel updated at date is in this format 2022-03-24T15:36:48.000000Z how can i pass it to my nuxtjs like this 2022/03/24 at 10:47
In my NuxtJs i am displaying it like this
{{ post.updated_at }}
In my controller i have
public function index()
{
$posts = Post::orderBy('created_at', 'desc')->paginate(10);
return response()->json($posts);
}
Either use a mutator on the model or use an api resource. I would use a resource
https://laravel.com/docs/9.x/eloquent-resources#main-content
Please or to participate in this conversation.