PHP code example of dedermus / open-admin-core

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

    

dedermus / open-admin-core example snippets


'url' => env('APP_URL', null),
'asset_url' => env('ASSET_URL', null),
'timezone' => 'Europe/Moscow',
'locale' => 'ru',

'disks' => [
    // ... другие диски

    'uploads' => [
        'driver' => 'local',
        'root' => public_path('uploads'),
        'url' => env('APP_URL').'/uploads',
        'visibility' => 'public',
        'throw' => false,
        'permissions' => [
            'file' => [
                'public' => 0644,
                'private' => 0600,
            ],
            'dir' => [
                'public' => 0755,
                'private' => 0700,
            ],
        ],
    ],

    'admin' => [
        'driver' => 'local',
        'root' => public_path('uploads'),
        'url' => env('APP_URL').'/uploads',
        'visibility' => 'public',
        'throw' => false,
        'permissions' => [
            'file' => [
                'public' => 0644,
                'private' => 0600,
            ],
            'dir' => [
                'public' => 0755,
                'private' => 0700,
            ],
        ],
    ],
],

'https' => env('ADMIN_HTTPS', true),

'auth' => [
    'password_reset' => [
    'enabled' => true,           // Включить/отключить функционал
    'expire' => 60,              // Время жизни ссылки (минут)
    'throttle' => 3,             // Максимум попыток
    'throttle_decay_minutes' => 60, // Время блокировки после превышения
    ],
],

'channels' => [
    'password_reset' => [
    'driver' => 'daily',
    'path' => storage_path('logs/password-reset.log'),
    'level' => 'info',
    'days' => 30,
    ],
],

// app/Console/Kernel.php
protected function schedule(Schedule $schedule)
{
$schedule->command('admin:clear-resets')->daily();
}

$router->resource('posts', PostController::class);
bash
php artisan storage:link
bash
php artisan vendor:publish --provider="OpenAdminCore\Admin\AdminServiceProvider"
bash
php artisan admin:install
text
app/Admin/
├── Controllers/
│   ├── HomeController.php
│   ├── AuthController.php
│   └── ExampleController.php
├── bootstrap.php
└── routes.php
bash
php artisan admin:clear-resets
bash
php artisan admin:make "App\Models\Post" --title="Статьи"
bash
php artisan admin:permissions --tables=posts
bash
composer update dedermus/open-admin-core
php artisan vendor:publish --tag=open-admin-assets --force
php artisan view:clear
php artisan config:clear
bash
composer dump-autoload