Download the PHP package afiqiqmal/lara-pass-policy without Composer
On this page you can find all versions of the php package afiqiqmal/lara-pass-policy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package lara-pass-policy
Laravel Password Policy
Installation
You can install the package via composer:
You can publish and run the migrations with:
You can publish the config file with:
Out of the box, this package provide a view (Blade and Vue templates) to allow users to change own password. If you want to customize the default page you can publish the views with:
and customize as you like in:
resources/views/auth/verify-password-change.blade.php
, for standard stack (Blade templates)resource/js/Pages/Auth/VerifyPasswordChange.vue
, if your stack integrate Inertia
Then, be sure to specify the view name in config/lara-pass-policy.views.password-changed
.
NOTE: Currently, only Vue stack are supported out of the box: for React/Svelte stack you must create a new page
component in resources/js/Pages/Auth
, just like the Vue page provided.
Usage
Add HasPasswordPolicy
trait to the authenticable model
Add MustVerifyPasswordPolicy
interface to the authenticable model
Add Middleware
Add EnsurePasswordIsChanged
middleware in $routeMiddleware
so you can attach it to your routes:
Translations.
You may translate the package string messages (defined in config lara-pass.messages
) adding the translated strings in lang/<locale>.json
files.
Environment settings.
If you want to disable Password Policy on specific environment (ex: local
) set to false
this variable in .env
file:
You may also customize the number of days before the passwords expire setting the variable in .env
file:
Validation rules.
If you need to apply your own default password rules, you should define a defaults
callback within the boot method
of one of your application's service providers, as described in
Laravel docs: this package
will validate new passwords against those defaults.
Credits
- Hafiq
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of lara-pass-policy with dependencies
illuminate/contracts Version ^7 || ^8 || ^9 || ^10 || ^11
illuminate/support Version ^7 || ^8 || ^9 || ^10 || ^11
illuminate/auth Version ^7 || ^8 || ^9 || ^10 || ^11