PHP code example of saaksin / laravel-administrator

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

    

saaksin / laravel-administrator example snippets


'providers' => [
    ...
    SaAkSin\Administrator\AdministratorServiceProvider::class
]

// administrator/users.php (권장 방식)
return array(
    'title' => '사용자 관리',
    'single' => '사용자',
    'model' => App\Models\User::class,

    // 데이터 목록에 노출할 컬럼 정의
    'columns' => array(
        'id' => array(
            'title' => 'ID',
        ),
        'name' => array(
            'title' => '이름',
        ),
        'email' => array(
            'title' => '이메일',
        ),
    ),

    // 데이터 필터링 조건 정의
    'filters' => array(
        'name' => array(
            'title' => '이름 검색',
            'type'  => 'text',
        ),
    ),

    // 등록 및 수정 폼 필드 구성
    'edit_fields' => array(
        'name' => array(
            'title' => '이름',
            'type'  => 'text',
        ),
        'email' => array(
            'title' => '이메일',
            'type'  => 'text',
        ),
        'password' => array(
            'title' => '비밀번호',
            'type'  => 'password',
        ),
    ),
);

// 활성화할 테마 설정 (기본값: 'silver')
'theme' => 'silver',

// 지원하는 테마 및 에셋 매핑 정의 (레거시 테마는 추가 스타일을 로드하지 않음)
'themes' => array(
    'silver' => array(
        'label' => '실버',
        'entry' => 'resources/css/themes/silver.css',
    ),
    'legacy' => array(
        'label' => '레거시',
        'entry' => null,
    ),
),

// 추가로 로드할 사용자 정의 스타일시트 (테마 스타일 이후 로드됨)
'custom_css' => array(
    'custom' => asset('css/custom.css'),
),

// 추가로 로드할 사용자 정의 자바스크립트 (앱 메인 스크립트 이후 로드됨)
'custom_js' => array(
    'custom' => asset('js/custom.js'),
),

use Illuminate\Routing\UrlGenerator;

public function boot(UrlGenerator $url)
{
    if (app()->environment('production')) {
        $url->forceScheme('https');
    }
}

'filters' => array(
    'no' => array(
        'title' => 'Number',
        'type' => 'fulltext_mysql'
    ),
),

'filters' => array(
    'no' => array(
        'title' => 'Name',
        'type' => 'text_quick'
    ),
),

'action' => array(
    'reload' => true
),

'view' => true
sh
php artisan octane:reload
sh
php artisan vendor:publish --provider="SaAkSin\Administrator\AdministratorServiceProvider" --force