PHP code example of iankov / control-panel

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

    

iankov / control-panel example snippets


    'guards' => [
        ...
        'admin' => [
            'driver' => 'session',
            'provider' => 'admins',
        ],
    ],
    'providers' => [
        ...
        'admins' => [
            'driver' => 'eloquent',
            'model' => Iankov\ControlPanel\Models\Admin::class,
        ],
    ],
    'passwords' => [
        ...
        'admins' => [
            'provider' => 'admins',
            'table' => 'admin_password_resets',
            'expire' => 60,
        ],
    ],
    

    Barryvdh\Elfinder\ElfinderServiceProvider::class
    

        'route' => [
            'prefix' => 'control/elfinder',
            'middleware' => 'icp', //Set to null to disable middleware filter
        ],
        
        //UIRED)
                'path' => public_path('images'), // path to files (REQUIRED)
                'URL' => '/images', // URL to files (REQUIRED)
                'uploadOrder' => ['allow', 'deny'],
                'uploadAllow' => ['image'], # allow any images
            ],
            'root' => [
                'alias' => '/',
                'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
                'path' => public_path(''), // path to files (REQUIRED)
                'URL' => '/', // URL to files (REQUIRED)
            ]
        ],
        
        //default options for all roots
        'root_options' => array(
            'accessControl' => '', // filter callback (OPTIONAL)
            'tmbURL' => '/_tmb',
            'tmbPath' => public_path('_tmb').'/',
        ),
    

Route::group(['prefix' => 'news', 'as' => 'news.'], function(){
    Route::get('create', ['as' => 'create', 'uses' => 'NewsController@create']);
    Route::delete('{id}', ['as' => 'delete', 'uses' => 'NewsController@delete']);
});

'news' => [
    'route' => [
        'path' => base_path('routes/control/news.php'), //

[
    'icon' => 'list', //menu icon <i class="fa fa-list"></i>
    'title' => 'News', //menu title text
    'link' => icp_route('news') //<a href="icp_route('news')"
],
bash
    php artisan vendor:publish --tag=icp_config
    
bash
    php artisan vendor:publish --tag=icp_public
    
bash
    php artisan vendor:publish --tag=icp_migrations
    
bash
    php artisan vendor:publish --tag=icp_seeds
    
bash
    php artisan migrate
    
bash
    composer dump-autoload
    
bash
    php artisan db:seed --class=Admins
    
bash
    php artisan elfinder:publish
    
bash
    php artisan vendor:publish --tag=icp_public
    
bash
    php artisan vendor:publish --provider='Barryvdh\Elfinder\ElfinderServiceProvider' --tag=config
    
routes/control/news.php
config/icp.php file
/app/Http/Controllers/Control/NewsController.php
config/icp-menu.php
config/icp-menu.php
bash
php artisan vendor:publish --tag=icp_views