This commit is contained in:
nurmuhammet committed 2025-10-22 20:08:22 +05:00
commit 736e3bef18
2573 files changed
+120385

No files matched your search

@@ -0,0 +1,35 @@
<?php
use Illuminate\Http\RedirectResponse;
if (! function_exists('baseLocales')) {
/**
* Application locales
*
* @return array<string, string>
*/
function baseLocales(): array
{
/** @var array<string, string> */
$locales = config()->array('module.base-locale.locales');
return $locales;
}
}
if (! function_exists('safe_back')) {
/**
* Safe back
*/
function safe_back(string $fallback = '/'): RedirectResponse
{
$back = url()->previous();
// Allow only your own domain
if (! str_starts_with($back, config()->string('app.url'))) {
return redirect($fallback);
}
return redirect()->to($back);
}
}