Date Parse

This commit is contained in:
2020-08-14 03:31:57 +05:00
parent 79b2b7ea36
commit a0cb23668c
3 changed files with 11 additions and 2 deletions

View File

@@ -32,6 +32,15 @@ class Article extends Model
*/
protected $guarded = [];
/**
* The attributes that should be mutated to dates.
*
* @var array
*/
protected $dates = [
'published_date',
];
/**
* The attributes that should be cast.

View File

@@ -29,7 +29,7 @@
<img src="{{$article->source->logo}}" class="h-10 w-10 rounded-full mr-2 object-cover" />
<div>
<p class="font-semibold text-gray-200 text-md MvTyper">{{$article->source->name}}</p>
<p class="font-semibold text-gray-400 text-xs">{{$article->published_date}}</p>
<p class="font-semibold text-gray-400 text-xs MvTyper" style="direction: rtl;">{{$article->published_date->locale('dv')->isoFormat('Do MMMM YYYY | dddd | h:mm')}}</p>
</div>
</div>
</div>

View File

@@ -3,7 +3,7 @@
@section('content')
<div>
<section class="mx-auto max-w-6xl py-5">
<div class="flex flex-col">
<div class="flex flex-col"
<div class="flex flex-col md:flex-row justify-center items-center">
<div class="transition-all ease-in-out duration-1000 flex flex-col justify-center">
<div slot="middle-right" class="max-w-xs">