PHP code example of jiny / admin

1. Go to this page and download the library: Download jiny/admin 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/ */

    

jiny / admin example snippets


// routes/web.php
Route::middleware(['admin', 'ip.whitelist', 'captcha'])->group(function () {
    Route::get('/admin/dashboard', [DashboardController::class, 'index']);
});

use Jiny\Admin\Services\Security\TwoFactorService;

$twoFactor = new TwoFactorService();
$qrCode = $twoFactor->generateQRCode($user);
$verified = $twoFactor->verify($user, $code);

use Jiny\Admin\Services\Captcha\CaptchaManager;

$captcha = app(CaptchaManager::class);
$verified = $captcha->verify($request->get('g-recaptcha-response'));

use Jiny\Admin\Models\AdminIpWhitelist;

AdminIpWhitelist::create([
    'ip_address' => '192.168.1.1',
    'description' => 'Office IP',
    'is_active' => true
]);
bash
php artisan migrate
bash
php artisan vendor:publish --provider="Jiny\Admin\JinyAdminServiceProvider"
bash
php artisan admin:user-create
bash
# 전체 테스트 실행
php artisan test

# 특정 테스트 실행
php artisan test --filter=AdminTest