CodeIgniter4 Boilerplate based on AdminLTE 3 with user management, roles, permissions, ...

v1.1.0 2021-02-01 11:34 UTC



68747470733a2f2f706f7365722e707567782e6f72672f6167756e67737567696172746f2f626f696c6572706c6174652f76657273696f6e 68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5061636b6167652d6167756e67737567696172746f253246626f696c6572706c6174652d6c696768742e737667 68747470733a2f2f706f7365722e707567782e6f72672f6167756e67737567696172746f2f626f696c6572706c6174652f646f776e6c6f616473 68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6167756e67737567696172746f2f626f696c6572706c617465

CodeIgniter 4 Application Boilerplate

This package for CodeIgniter 4 serves as a basic platform for quickly creating a back-office application. It includes profile creation and management, user management, roles, permissions and a dynamically-generated menu.


This project is still early in its development... please feel free to contribute!

Screenshoot | Demo On Heroku



1. Get The Module, since the myth/auth packages is still under development, we need to change composer.json in root project directory. Open composer.json with your text editor and add code like this, or below like this.

"minimum-stability": "dev",
"prefer-stable": true,

And run require via composer

composer require agungsugiarto/boilerplate

2. Set CI_ENVIRONMENT, baseURL, index page, and database config in your .env file based on your existing database (If you don't have a .env file, you can copy first from env file: cp env .env first). If the database does not exist, create the database first.

# .env file
CI_ENVIRONMENT = development

app.baseURL = 'http://localhost:8080'
app.indexPage = ''

database.default.hostname = localhost
database.default.database = boilerplate
database.default.username = root
database.default.password =
database.default.DBDriver = MySQLi

3. Run publish auth

php spark auth:publish

Publish Migration? [y, n]: y
  created: Database/Migrations/2017-11-20-223112_create_auth_tables.php
  Remember to run `spark migrate -all` to migrate the database.
Publish Models? [y, n]: n
Publish Entities? [y, n]: n
Publish Controller? [y, n]: n
Publish Views? [y, n]: n
Publish Filters? [y, n]: n
Publish Config file? [y, n]: y
  created: Config/Auth.php
Publish Language file? [y, n]: n

NOTE: Everything about how to configure auth you can find add Myth/Auth.

Is it ready yet? Not so fast!! ;-) After publishing Config/Auth.php you need to change public $views with these lines below:

public $views = [
    'login'           => 'agungsugiarto\boilerplate\Views\Authentication\login',
    'register'        => 'agungsugiarto\boilerplate\Views\Authentication\register',
    'forgot'          => 'agungsugiarto\boilerplate\Views\Authentication\forgot',
    'reset'           => 'agungsugiarto\boilerplate\Views\Authentication\reset',
    'emailForgot'     => 'agungsugiarto\boilerplate\Views\Authentication\emails\forgot',
    'emailActivation' => 'agungsugiarto\boilerplate\Views\Authentication\emails\activation',

Open app\Config\Filters.php, find $aliases and add these lines below:

public $aliases = [
    'login'      => \Myth\Auth\Filters\LoginFilter::class,
    'role'       => \agungsugiarto\boilerplate\Filters\RoleFilter::class,
    'permission' => \agungsugiarto\boilerplate\Filters\PermissionFilter::class,

4. Run publish, migrate and seed boilerplate

php spark boilerplate:install

5. Run development server:

php spark serve

6. Open in browser http://localhost:8080/admin

Default user and password
| No | User   | Password    |
| 1  | admin  | super-admin |
| 2  | user   | super-user  |


Config Boilerplate

You can configure default dashboard controller and backend theme in app\Config\Boilerplate.php,

class Boilerplate extends BaseConfig
    public $appName = 'Boilerplate';

    public $dashboard = [
        'namespace'  => 'agungsugiarto\boilerplate\Controllers',
        'controller' => 'DashboardController::index',
        'filter'     => 'permission:back-office',
// App/Config/Boilerplate.php


You can find how it works with the read code routes, controller and views etc. Finnally... Happy Coding!


Please see CHANGELOG for more information what has changed recently.


Contributions are very welcome.


This package is free software distributed under the terms of the MIT license.