PHPackages                             iankov/control-panel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. iankov/control-panel

ActiveLibrary[Admin Panels](/categories/admin)

iankov/control-panel
====================

Admin panel for laravel

v1.0.13(7y ago)1562HTML

Since Jan 1Pushed 7y ago1 watchersCompare

[ Source](https://github.com/iankov/control-panel)[ Packagist](https://packagist.org/packages/iankov/control-panel)[ RSS](/packages/iankov-control-panel/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (3)Versions (15)Used By (2)

Installation
============

[](#installation)

```
 composer require iankov/control-panel
```

- Update guards, providers, passwords in `config/auth.php`

    ```
    '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,
        ],
    ],
    ```
- Publish config file

    ```
    php artisan vendor:publish --tag=icp_config
    ```
- Publish public assets

    ```
    php artisan vendor:publish --tag=icp_public
    ```
- Publish migrations

    ```
    php artisan vendor:publish --tag=icp_migrations
    ```
- Publish seeds

    ```
    php artisan vendor:publish --tag=icp_seeds
    ```
- Run migrations

    ```
    php artisan migrate
    ```
- Run dump autoload

    ```
    composer dump-autoload
    ```
- Run seeder to insert initial admin user. Login: , Password: admin

    ```
    php artisan db:seed --class=Admins
    ```

Elfinder file manager integration
---------------------------------

[](#elfinder-file-manager-integration)

[Laravel elfinder package](https://github.com/barryvdh/laravel-elfinder)

[Configuration options](https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options-2.1)

- Add the ServiceProvider to the providers array in `app/config/app.php`

    ```
    Barryvdh\Elfinder\ElfinderServiceProvider::class
    ```
- You need to copy the assets to the public folder, using the following artisan command:

    ```
    php artisan elfinder:publish
    ```
- Copy `vendor/iankov/control-panel/public/packages/barryvdh` to `public/barryvdh`. You can do this by publishing iankov/control-panel assets

    ```
    php artisan vendor:publish --tag=icp_public
    ```
- Publish the config file

    ```
    php artisan vendor:publish --provider='Barryvdh\Elfinder\ElfinderServiceProvider' --tag=config
    ```
- Change elfinder config

    ```
        'route' => [
            'prefix' => 'control/elfinder',
            'middleware' => 'icp', //Set to null to disable middleware filter
        ],

        //required for default ckeditor integration: images/files browse/upload
        'roots' => [
            'images' => [
                'alias' => '/images',
                'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
                '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').'/',
        ),
    ```
- Create 'images' folder in your public dir to match `roots.images` config path

Developing a new module
=======================

[](#developing-a-new-module)

### Basic concept

[](#basic-concept)

Basic concept of building a module is to make a separate route file for the module. You can place it in a standard `routes/` folder. I.e. if you make a module to create and delete news, it could be `routes/control/news.php` file with the following content:

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

### Registering a module

[](#registering-a-module)

When you make a new module, you need to add it to `config/icp.php file`. Minimum requirement is to add route path to the `module` array like this:

```
'news' => [
    'route' => [
        'path' => base_path('routes/control/news.php'), //required
        'namespace' => '\App\Http\Controllers\Control', //optional
    ]
],
```

Optional parameter `namespace` defines a namespace for our controller. In our case `NewsController` is most likely located in `/app/Http/Controllers/Control/NewsController.php`

### Adding menu item

[](#adding-menu-item)

After you register a module, you'll be able to use routes in `config/icp-menu.php` like this:

```
[
    'icon' => 'list', //menu icon
    'title' => 'News', //menu title text
    'link' => icp_route('news') //
