Date Parse
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user