<?php
declare(strict_types=1);
namespace App\Helpers;
use Rawilk\FormComponents\Support\TimeZoneRegionEnum;
function timezoneSubsets(): array
{
return [
TimeZoneRegionEnum::General->value,
TimeZoneRegionEnum::America->value,
];
}
<?php
declare(strict_types=1);
use Symfony\Component\Finder\Finder;
$files = Finder::create()
->files()
->in(__DIR__)
->depth(0)
->name('*.php');
foreach ($files as $file) {
require_once $file;
}
<?php
declare(strict_types=1);
namespace App\Helpers;
function defaultLoginRedirect(): string
{
return auth()->user()?->can('viewAdminPanel')
? route('admin.dashboard')
: route('profile.show');
}
function homeRoute(): string
{
if (auth()->check() && auth()->user()->isSuperAdmin()) {
return route('admin.dashboard');
}
return '/';
}
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
},
"files": [
"app/Helpers/helpers.php"
]
},