1. Go to this page and download the library: Download sashalenz/passcode-lock 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/ */
sashalenz / passcode-lock example snippets
use Sashalenz\PasscodeLock\Traits\HasPasscodeLock;
class Admin extends Authenticatable
{
use HasPasscodeLock;
// ...
}
use Sashalenz\PasscodeLock\Http\Middleware\PasscodeLockMiddleware;
$middleware->appendToGroup('web', [
// ...
PasscodeLockMiddleware::class,
]);
use Sashalenz\PasscodeLock\Http\Controllers\LockController;
// Do not protect with auth so unlock works without re-login
$router->get('lock', [LockController::class, 'show'])->name('lock.show');
$router->post('lock', [LockController::class, 'unlock'])->name('lock.unlock');
$router->get('lock/trigger', [LockController::class, 'trigger'])
->middleware('auth:admin') // or your guard
->name('lock.trigger');