Skip to main content

Configuration

Every setting has a default, so the package works without a published configuration file. To change a setting that has no environment variable, publish the file:

php artisan vendor:publish --tag=fortify-hardening-config

A published file keeps receiving settings that later releases add, because the package merges its defaults under it key by key. A list you set, such as notice_channels, stands as you wrote it.

Settings​

KeyEnvironment variableDefaultWhat it does
password_reset_link.enabledFORTIFY_HARDENING_PASSWORD_RESET_LINKtrueanswers every reset-link request like a sent link
password_reset.enabledFORTIFY_HARDENING_PASSWORD_RESETtrueanswers every failed reset like a wrong token
registration.enabledFORTIFY_HARDENING_REGISTRATIONtrueputs the neutral registration on Fortify's route
registration.requestRegistrationRequest::classthe form request that validates a registration
registration.redirect_route'login'where a web registration is redirected to
registration.sign_in_route'login'where the notice's button leads
registration.notificationAccountAlreadyExistsNotification::classthe notice the holder of a taken address receives
registration.notice_channels['mail']the channels the notice goes out on
registration.notice_mentions_password_resettruewhether the notice says that a forgotten password can be reset
registration.max_mails_per_hourFORTIFY_HARDENING_MAX_MAILS_PER_HOUR1how many mails the registration may send to one address within an hour
timebox.microsecondsFORTIFY_HARDENING_TIMEBOX_MICROSECONDS1000000the minimum duration of a failed sign-in, a reset-link request and a failed reset
hashed_login_keys.enabledFORTIFY_HARDENING_HASHED_LOGIN_KEYStruecounts failed sign-ins under a hashed key instead of the address and the IP

A value the package cannot use falls back to its default: a mail budget below one is one, and a negative minimum duration is the default. A minimum of 0 leaves Laravel's own in place, and a value your application sets in auth.timebox_duration always wins over the package's. See Timing for what the minimum covers.

Each of the four enabled switches is off for false, 0, no or off, in any case and with spaces around it. Any other value keeps the section on, and so does a variable that is not set or set to nothing, as copying a template of a .env leaves one: each section is a hardening, and an empty line doesn't drop it.

Switching off the registration takes the package's controller off Fortify's route. The registrar stays available to a controller of your own.

Translations​

The answer to a registration and the notice are written in German, English, Spanish, French, Italian, Dutch and Portuguese, in the application's locale. The answers on the password routes are Laravel's own and come from your application's passwords translations.

A regional locale reads the catalog of its language: pt-BR and pt-PT read pt, en-GB reads en, and so does a region nobody listed, such as fr-CA or de_AT. The Portuguese catalog is written as in Portugal. A catalog you publish for the region under lang/vendor/fortify-hardening/pt-BR/ wins over the language key by key, so a Brazilian wording needs only the keys that differ. This holds for the fortify-hardening namespace alone: your own translations keep Laravel's lookup, which goes from the locale straight to app.fallback_locale.

KeyEnglish
fortify-hardening::messages.registration.acceptedWe have sent an email to that address. Please check your inbox to continue.
fortify-hardening::messages.notice.subjectSomeone tried to register at :app with your email address
fortify-hardening::messages.notice.attemptSomeone tried to create an account with this email address, but you already have one.
fortify-hardening::messages.notice.actionSign in
fortify-hardening::messages.notice.nextIf that was you and you have forgotten your password, you can reset it from the sign-in page. If it was not you, there is nothing you need to do.
fortify-hardening::messages.notice.next_without_passwordIf that was you, you can sign in from the sign-in page. If it was not you, there is nothing you need to do.

To change a text, or to add a language, publish the translations and edit them in lang/vendor/fortify-hardening:

php artisan vendor:publish --tag=fortify-hardening-lang