PHP code example of larasoft / password-expirable

1. Go to this page and download the library: Download larasoft/password-expirable library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

larasoft / password-expirable example snippets



'providers' => [
    ...
    Larasoft\PasswordExpiry\PasswordExpiryServiceProvider::class,
],

return [

      // # of Days: After which user password gets expired and user should receive password reset email/notification
      'expiry_days' => 2,
  
      // Expiry message to send in password email/notification
      'expiry_message' => 'It has been over :number days since you reset your password. Please update it now.',
  
      'strong_password_rules' => 'case_diff|numbers|letters|symbols'
];
bash
php artisan migrate
bash
php artisan vendor:publish --provider="Larasoft\PasswordExpiry\PasswordExpiryServiceProvider" --tag="config"
 php
$user->getCurrentPasswordSetTime();
 php 
$user->isPasswordExpired();
 php 
protected $routeMiddleware = [
    ...
    'check-password-expired' => CheckPasswordExpired::class
]