Last active
May 20, 2025 08:33
-
-
Save aytacmalkoc/a125dd5771a17e2c1c1e9aa34496f252 to your computer and use it in GitHub Desktop.
Revisions
-
aytacmalkoc revised this gist
May 20, 2025 . 1 changed file with 27 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,4 +16,31 @@ function route_with_query($name, $parameters = [], $absolute = true): string { return route($name, [request()->getQueryString(), ...$parameters], $absolute); } } if (!function_exists('get_hours_24_format')) { function get_hours_24_format(): array { $hours = []; for ($i = 0; $i < 24; $i++) { $hours[] = str_pad($i, 2, '0', STR_PAD_LEFT) . ':00'; } return $hours; } } if (!function_exists('greeting')) { function greeting(): string { $hour = \Illuminate\Support\Carbon::now()->hour; return match (true) { $hour >= 6 && $hour < 12 => "🌥️ Günaydın", $hour >= 12 && $hour < 18 => "😎 İyi günler", $hour >= 18 && $hour < 23 => "🌚 İyi akşamlar", $hour >= 23 || $hour < 6 => "🌜 İyi geceler" }; } } -
aytacmalkoc revised this gist
Jan 12, 2025 . No changes.There are no files selected for viewing
-
aytacmalkoc revised this gist
Jan 12, 2025 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,3 +10,10 @@ function route_is(string|array $routeNames): bool return collect($routeNames)->contains(fn($routeName) => \Illuminate\Support\Str::is($routeName, $currentRoute)); } } if (!function_exists('route_with_query')) { function route_with_query($name, $parameters = [], $absolute = true): string { return route($name, [request()->getQueryString(), ...$parameters], $absolute); } } -
aytacmalkoc revised this gist
Jun 27, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ if (!function_exists('route_is')) { function route_is(string|array $routeNames): bool { $currentRoute = \Illuminate\Support\Facades\Route::currentRouteName(); $routeNames = (array) $routeNames; -
aytacmalkoc created this gist
Jun 27, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ <?php if (!function_exists('route_is')) { function route_is(string|array $routeNames): bool { $currentRoute = Route::currentRouteName(); $routeNames = (array) $routeNames; return collect($routeNames)->contains(fn($routeName) => \Illuminate\Support\Str::is($routeName, $currentRoute)); } }