Home Arrow Icon Knowledge base Arrow Icon Global Arrow Icon Laravel jetstream Fortify Configuration


Laravel jetstream Fortify Configuration


To customize the Fortify configuration in Laravel Jetstream, you can modify the `config/fortify.php` file. Here are some key points about configuring Fortify in Jetstream:

1. Enabling/Disabling Features:
- You can enable or disable various authentication features by modifying the `features` array in the `config/fortify.php` file.
- For example, to disable two-factor authentication, you can comment out the corresponding entry:

php
     'features' => [
         // ...
         // Features::twoFactorAuthentication(),
     ],
     

2. Customizing Redirect URLs:
- You can customize the redirect URLs for various authentication actions, such as login, logout, and registration.
- For example, to change the redirect URL after login, you can modify the `login_redirect_url` configuration:

php
     'login_redirect_url' => '/dashboard',
     

3. Configuring Authentication Guards:
- You can specify the authentication guard to be used for various authentication actions.
- For example, to use a custom authentication guard for login, you can modify the `guard` configuration:

php
     'guard' => 'custom_guard',
     

4. Customizing Password Rules:
- You can customize the password validation rules by modifying the `password_rules` configuration.
- For example, to require a password to be at least 10 characters long and contain at least one uppercase letter and one number, you can use:

php
     'password_rules' => ['min:10', 'uppercase', 'number'],
     

5. Configuring Throttling:
- You can configure throttling options for various authentication actions, such as login and two-factor authentication.
- For example, to limit login attempts to 5 per minute, you can modify the `limiters` configuration:

php
     'limiters' => [
         'login' => '5,1',
     ],
     

6. Customizing Email Verification:
- You can customize the email verification configuration, such as the verification email subject and view.
- For example, to change the verification email subject, you can modify the `verification_email_subject` configuration:

php
     'verification_email_subject' => 'Please verify your email address',
     

By modifying the `config/fortify.php` file, you can tailor the authentication behavior of your Laravel Jetstream application to match your specific requirements. However, it's important to note that some configurations may require additional customizations in your application code.

Citations:
[1] https://jetstream.laravel.com/features/authentication.html
[2] https://laracasts.com/discuss/channels/laravel/laravel-jetstream-login
[3] https://jetstream.laravel.com/features/two-factor-authentication.html
[4] https://www.itsolutionstuff.com/post/laravel-8-authentication-using-jetstream-exampleexample.html
[5] https://jetstream.laravel.com/features/registration.html