PHP code example of mixudev / laravel-authentication
1. Go to this page and download the library: Download mixudev/laravel-authentication 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/ */
mixudev / laravel-authentication example snippets
return [
// Model user aplikasi host (tanpa hardcode App\Models\User)
'user_model' => \App\Models\User::class,
'guard' => 'web',
// Fitur Kunci & Modul
'features' => [
// Passkey / WebAuthn FIDO2 Passwordless
'passkey' => [
'enabled' => true,
'rp_name' => env('APP_NAME', 'Laravel'),
'user_verification' => 'preferred',
'timeout' => 60000,
],
// Multi-Factor Authentication (2FA TOTP)
'two_factor' => [
'enabled' => true,
'trust_device' => ['enabled' => true, 'duration_days' => 30],
],
// Socialite OAuth (Google & GitHub)
'social' => [
'enabled' => true,
],
// Proteksi Bot Adaptif
'captcha' => [
'enabled' => false,
'driver' => 'turnstile', // 'turnstile', 'recaptcha_v2', 'hcaptcha'
'trigger_after_failed_attempts' => 3,
],
],
// Antarmuka & Tampilan UI
'ui' => [
'layout' => 'card', // 'card' atau 'split'
'theme' => 'auto', // 'light', 'dark', atau 'auto'
],
];
bash
php artisan authentication:install
bash
# Publikasi konfigurasi & migrasi
php artisan vendor:publish --tag=authentication-config
php artisan vendor:publish --tag=authentication-migrations
# Jalankan migrasi database
php artisan migrate
bash
# 1. Tarik pembaruan package terbaru
composer update mixudev/laravel-authentication
# 2. Jalankan migrasi jika ada skema database baru
php artisan migrate
# 3. Bersihkan cache view & konfigurasi
php artisan view:clear
php artisan config:clear