diff --git a/src/Middlewares/CookiesLocale.php b/src/Middlewares/LocalizationByCookie.php similarity index 84% rename from src/Middlewares/CookiesLocale.php rename to src/Middlewares/LocalizationByCookie.php index a44e9b0..e40fd0c 100644 --- a/src/Middlewares/CookiesLocale.php +++ b/src/Middlewares/LocalizationByCookie.php @@ -6,7 +6,7 @@ use Illuminate\Http\Request; -class CookiesLocale extends Middleware +class LocalizationByCookie extends Middleware { protected function detect(Request $request): bool|float|int|string|null { diff --git a/src/Middlewares/HeaderLocale.php b/src/Middlewares/LocalizationByHeader.php similarity index 84% rename from src/Middlewares/HeaderLocale.php rename to src/Middlewares/LocalizationByHeader.php index bf0feba..bdb353e 100644 --- a/src/Middlewares/HeaderLocale.php +++ b/src/Middlewares/LocalizationByHeader.php @@ -6,7 +6,7 @@ use Illuminate\Http\Request; -class HeaderLocale extends Middleware +class LocalizationByHeader extends Middleware { protected function detect(Request $request): bool|float|int|string|null { diff --git a/src/Middlewares/ParameterLocale.php b/src/Middlewares/LocalizationByParameter.php similarity index 84% rename from src/Middlewares/ParameterLocale.php rename to src/Middlewares/LocalizationByParameter.php index d61652e..132be20 100644 --- a/src/Middlewares/ParameterLocale.php +++ b/src/Middlewares/LocalizationByParameter.php @@ -6,7 +6,7 @@ use Illuminate\Http\Request; -class ParameterLocale extends Middleware +class LocalizationByParameter extends Middleware { protected function detect(Request $request): bool|float|int|string|null { diff --git a/src/Middlewares/ParameterRedirectLocale.php b/src/Middlewares/LocalizationByParameterWithRedirect.php similarity index 96% rename from src/Middlewares/ParameterRedirectLocale.php rename to src/Middlewares/LocalizationByParameterWithRedirect.php index 424d32f..e416bb7 100644 --- a/src/Middlewares/ParameterRedirectLocale.php +++ b/src/Middlewares/LocalizationByParameterWithRedirect.php @@ -13,7 +13,7 @@ use function array_merge; use function response; -class ParameterRedirectLocale extends Middleware +class LocalizationByParameterWithRedirect extends Middleware { use KeyNames; diff --git a/src/Middlewares/SessionLocale.php b/src/Middlewares/LocalizationBySession.php similarity index 85% rename from src/Middlewares/SessionLocale.php rename to src/Middlewares/LocalizationBySession.php index e849e9f..4dcd5ed 100644 --- a/src/Middlewares/SessionLocale.php +++ b/src/Middlewares/LocalizationBySession.php @@ -6,7 +6,7 @@ use Illuminate\Http\Request; -class SessionLocale extends Middleware +class LocalizationBySession extends Middleware { protected function detect(Request $request): bool|float|int|string|null { diff --git a/tests/Concerns/Routes.php b/tests/Concerns/Routes.php index f4bdf6b..c388d87 100644 --- a/tests/Concerns/Routes.php +++ b/tests/Concerns/Routes.php @@ -5,11 +5,11 @@ namespace Tests\Concerns; use Closure; -use LaravelLang\Routes\Middlewares\CookiesLocale; -use LaravelLang\Routes\Middlewares\HeaderLocale; -use LaravelLang\Routes\Middlewares\ParameterLocale; -use LaravelLang\Routes\Middlewares\ParameterRedirectLocale; -use LaravelLang\Routes\Middlewares\SessionLocale; +use LaravelLang\Routes\Middlewares\LocalizationByCookie; +use LaravelLang\Routes\Middlewares\LocalizationByHeader; +use LaravelLang\Routes\Middlewares\LocalizationByParameter; +use LaravelLang\Routes\Middlewares\LocalizationByParameterWithRedirect; +use LaravelLang\Routes\Middlewares\LocalizationBySession; use Tests\Constants\LocaleValue; use function app; @@ -24,31 +24,31 @@ public function setUpRoutes(): void ->middleware('web') ->group(function () { app('router') - ->middleware(ParameterLocale::class) + ->middleware(LocalizationByParameter::class) ->get('path/{foo}/{locale?}', $this->jsonResponse()) ->name('via.parameter'); app('router') - ->middleware(ParameterRedirectLocale::class) + ->middleware(LocalizationByParameterWithRedirect::class) ->get('redirect/{foo}/{locale?}', $this->jsonResponse()) ->name('via.parameter.redirect'); app('router') - ->middleware(ParameterRedirectLocale::class) + ->middleware(LocalizationByParameterWithRedirect::class) ->get('not-named/redirect/{foo}/{locale?}', $this->jsonResponse()); app('router') - ->middleware(HeaderLocale::class) + ->middleware(LocalizationByHeader::class) ->get('header/{foo}', $this->jsonResponse()) ->name('via.header'); app('router') - ->middleware(CookiesLocale::class) + ->middleware(LocalizationByCookie::class) ->get('cookie/{foo}', $this->jsonResponse()) ->name('via.cookie'); app('router') - ->middleware(SessionLocale::class) + ->middleware(LocalizationBySession::class) ->get('session/{foo}', $this->jsonResponse()) ->name('via.session'); });