small fixes
This commit is contained in:
@@ -26,7 +26,13 @@ class PostItemResource extends JsonResource
|
||||
'authors' => $this->authors,
|
||||
'gallery' => $this->images,
|
||||
'reading_time' => $this->reading_time,
|
||||
'created_post' => Carbon::parse($this->publish_at)->diffforhumans(),
|
||||
'created_post' => Carbon::parse($this->publish_at)
|
||||
->locale('ru')
|
||||
->translatedFormat(
|
||||
Carbon::parse($this->publish_at)->isCurrentYear()
|
||||
? 'd M'
|
||||
: 'd M Y' . ' г.'
|
||||
)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,13 @@ class PostListResource extends JsonResource
|
||||
'authors' => $this->authors,
|
||||
'preview' => $this->preview,
|
||||
'reading_time' => $this->reading_time,
|
||||
'created_post' => Carbon::parse($this->publish_at)->diffforhumans(),
|
||||
'created_post' => Carbon::parse($this->publish_at)
|
||||
->locale('ru')
|
||||
->translatedFormat(
|
||||
Carbon::parse($this->publish_at)->isCurrentYear()
|
||||
? 'd M'
|
||||
: 'd M Y'
|
||||
)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,10 +26,6 @@ class HandleInertiaRequests extends Middleware
|
||||
'auth' => [
|
||||
'user' => $request->user() ? $request->user()->only('id', 'name', 'email', 'created_at') : null,
|
||||
],
|
||||
// 'ziggy' => fn () => [
|
||||
// ...(new Ziggy)->toArray(),
|
||||
// 'location' => $request->url(),
|
||||
// ],
|
||||
'ziggy' => function() {
|
||||
return array_merge((new Ziggy())->toArray(), [
|
||||
'location' => url()->current(),
|
||||
|
||||
Reference in New Issue
Block a user