|
|
|
@ -159,3 +159,42 @@ class User extends Authenticatable
|
|
|
|
|
...
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
9) MMiddleware
|
|
|
|
|
|
|
|
|
|
Para validação das rotas com a data de validação das senhas, adicione o middleware:
|
|
|
|
|
|
|
|
|
|
- Versão 10.*:
|
|
|
|
|
```app\Http\Kernel.php```
|
|
|
|
|
```php
|
|
|
|
|
protected $routeMiddleware = [
|
|
|
|
|
...
|
|
|
|
|
\Pablo\Ae3auth\app\Http\InvalidPasswordMiddleware::class,
|
|
|
|
|
];
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
- Versão 11.*
|
|
|
|
|
```bootstrap/app.php```
|
|
|
|
|
|
|
|
|
|
```php
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Application;
|
|
|
|
|
use Illuminate\Foundation\Configuration\Exceptions;
|
|
|
|
|
use Illuminate\Foundation\Configuration\Middleware;
|
|
|
|
|
|
|
|
|
|
return Application::configure(basePath: dirname(__DIR__))
|
|
|
|
|
->withRouting(
|
|
|
|
|
web: __DIR__.'/../routes/web.php',
|
|
|
|
|
api: __DIR__.'/../routes/api.php',
|
|
|
|
|
commands: __DIR__.'/../routes/console.php',
|
|
|
|
|
health: '/up',
|
|
|
|
|
)
|
|
|
|
|
->withMiddleware(function (Middleware $middleware) {
|
|
|
|
|
$middleware->alias([
|
|
|
|
|
'auth.invalid-password' => \Pablo\Ae3auth\app\Http\InvalidPasswordMiddleware::class,
|
|
|
|
|
]);
|
|
|
|
|
})
|
|
|
|
|
->withExceptions(function (Exceptions $exceptions) {
|
|
|
|
|
//
|
|
|
|
|
})->create();
|
|
|
|
|
```
|