diff --git a/README.md b/README.md index 42d60b1..b88a492 100644 --- a/README.md +++ b/README.md @@ -127,21 +127,29 @@ use Illuminate\Contracts\Auth\MustVerifyEmail; class User extends Authenticatable implements MustVerifyEmail ``` -Then you can add the `verified:filament.verification.notice` middleware to any of your routes: +Then you can add the `verified` middleware to any of your routes: ```php Route::get("/profile", function () { // Only verified users may access this route... -})->middleware('verified:filament.verification.notice'); +})->middleware('verified'); ``` -Or, force verified emails on your entire Filament Admin by adding the `verified:filament.verification.notice` class to the auth middleware in `config/filament.php`: +Or, if you're using a custom route name prefix: + +```php +Route::get("/profile", function () { + // Only verified users may access this route... +})->middleware('verified:my-prefix.verification.notice'); +``` + +To force verified emails on your entire Filament Admin by adding the `verified` class to the auth middleware in `config/filament.php`: ```php "middleware" => [ "auth" => [ Authenticate::class, - 'verified:filament.verification.notice' + 'verified' ], .... ``` diff --git a/config/filament-breezy.php b/config/filament-breezy.php index 554230f..314f42e 100644 --- a/config/filament-breezy.php +++ b/config/filament-breezy.php @@ -45,7 +45,11 @@ | The column to use for login/username authentication. NOTE: this may change to just 'login_field' in a later release. */ "fallback_login_field" => "email", - + /* + |-------------------------------------------------------------------------- + | Set a route name prefix for all of Breezy's auth routes. Ex. set filament. to prefix all route names, filament.register. WARNING: if you use a custom route prefix, you'll need to override the default auth routes used throughout your application. This is outside of Breezy's scope and will be up to the dev to maintain. Use at your own risk. See example: https://laravel.com/docs/9.x/passwords#password-customization + */ + "route_group_prefix"=>'', /* |-------------------------------------------------------------------------- | Enable Two-Factor Authentication (2FA). diff --git a/resources/views/login.blade.php b/resources/views/login.blade.php index 6565c5b..8dd8c4b 100644 --- a/resources/views/login.blade.php +++ b/resources/views/login.blade.php @@ -11,7 +11,7 @@ @if(config("filament-breezy.enable_registration"))
{{ __('filament-breezy::default.or') }} - + {{ strtolower(__('filament-breezy::default.registration.heading')) }}
@@ -25,6 +25,6 @@ diff --git a/routes/web.php b/routes/web.php index 9fdae77..748f5c2 100644 --- a/routes/web.php +++ b/routes/web.php @@ -5,23 +5,24 @@ Route::domain(config("filament.domain")) ->middleware(config("filament.middleware.base")) + ->name(config('filament-breezy.route_group_prefix')) ->prefix(config("filament.path")) ->group(function () { // Login will be replaced in the Filament config. if (config("filament-breezy.enable_registration")) { - Route::get("/register", config('filament-breezy.registration_component_path'))->name("filament.register"); + Route::get("/register", config('filament-breezy.registration_component_path'))->name("register"); } Route::get("/password/reset", config('filament-breezy.password_reset_component_path'))->name( - "filament.password.request" + "password.request" ); Route::get("/password/reset/{token}", config('filament-breezy.password_reset_component_path'))->name( - "filament.password.reset" + "password.reset" ); Route::get("email/verify", config('filament-breezy.email_verification_component_path')) ->middleware(["throttle:6,1","auth"]) - ->name("filament.verification.notice"); + ->name("verification.notice"); Route::get("email/verify/{id}/{hash}", [ EmailVerificationController::class, diff --git a/src/FilamentBreezyServiceProvider.php b/src/FilamentBreezyServiceProvider.php index 6c01baa..f594b50 100644 --- a/src/FilamentBreezyServiceProvider.php +++ b/src/FilamentBreezyServiceProvider.php @@ -5,7 +5,6 @@ use Filament\Facades\Filament; use Filament\Navigation\UserMenuItem; use Filament\PluginServiceProvider; -use Illuminate\Auth\Notifications\ResetPassword; use JeffGreco13\FilamentBreezy\Commands\FilamentBreezyCommand; use JeffGreco13\FilamentBreezy\Http\Livewire\Auth; use JeffGreco13\FilamentBreezy\Http\Livewire\BreezySanctumTokens; @@ -60,10 +59,6 @@ public function packageBooted(): void ]); }); } - - ResetPassword::createUrlUsing(function ($user, string $token) { - return route('filament.password.reset', ['token' => $token]); - }); } protected function getPages(): array