add types

This commit is contained in:
2024-05-06 17:13:38 +05:00
parent 88b934bda1
commit e5907fe3a9
46 changed files with 465 additions and 184 deletions

View File

@@ -69,6 +69,8 @@ class NovaServiceProvider extends NovaApplicationServiceProvider
/**
* Get the dashboards that should be listed in the Nova sidebar.
*
* @return array<int, \App\Nova\Dashboards\Main>
*/
protected function dashboards(): array
{
@@ -79,6 +81,8 @@ class NovaServiceProvider extends NovaApplicationServiceProvider
/**
* Get the tools that should be listed in the Nova sidebar.
*
* @return array<int, string>
*/
public function tools(): array
{
@@ -111,7 +115,7 @@ class NovaServiceProvider extends NovaApplicationServiceProvider
public function setupUserNavigation(): void
{
Nova::userMenu(function (Request $request, Menu $menu) {
$menu->prepend(MenuItem::make(__('My Profile'), $request->user()->profilePage()));
$menu->prepend(MenuItem::make(__('My Profile'), $request->user()?->profilePage()));
return $menu;
});
@@ -138,7 +142,9 @@ class NovaServiceProvider extends NovaApplicationServiceProvider
*/
public function setupFieldMacros(): void
{
// @phpstan-ignore-next-line
Date::macro('toTurkmenFormat', fn () => $this->displayUsing(fn ($value) => $value?->format('d.m.Y')));
// @phpstan-ignore-next-line
DateTime::macro('turkmenDateTime', fn () => $this->displayUsing(fn ($value) => $value?->format('H:i, d.m.Y')));
}
}