项目作者: agungsugiarto

项目描述 :
CodeIgniter4 Boilerplate based on AdminLTE 3 with user management, roles, permissions, ...
高级语言: PHP
项目地址: git://github.com/agungsugiarto/boilerplate.git
创建时间: 2020-02-27T04:41:18Z
项目社区:https://github.com/agungsugiarto/boilerplate

开源协议:MIT License

下载







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.

Feature

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

Screenshoot | Demo On Heroku

Dashboard

Installation

1. Get The Module

  1. 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.

  1. # .env file
  2. CI_ENVIRONMENT = development
  3. app.baseURL = 'http://localhost:8080'
  4. app.indexPage = ''
  5. database.default.hostname = localhost
  6. database.default.database = boilerplate
  7. database.default.username = root
  8. database.default.password =
  9. database.default.DBDriver = MySQLi

3. Run publish auth

  1. php spark auth:publish
  2. Publish Migration? [y, n]: y
  3. created: Database/Migrations/2017-11-20-223112_create_auth_tables.php
  4. Remember to run `spark migrate -all` to migrate the database.
  5. Publish Models? [y, n]: n
  6. Publish Entities? [y, n]: n
  7. Publish Controller? [y, n]: n
  8. Publish Views? [y, n]: n
  9. Publish Filters? [y, n]: n
  10. Publish Config file? [y, n]: y
  11. created: Config/Auth.php
  12. 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:

  1. public $views = [
  2. 'login' => 'agungsugiarto\boilerplate\Views\Authentication\login',
  3. 'register' => 'agungsugiarto\boilerplate\Views\Authentication\register',
  4. 'forgot' => 'agungsugiarto\boilerplate\Views\Authentication\forgot',
  5. 'reset' => 'agungsugiarto\boilerplate\Views\Authentication\reset',
  6. 'emailForgot' => 'agungsugiarto\boilerplate\Views\Authentication\emails\forgot',
  7. 'emailActivation' => 'agungsugiarto\boilerplate\Views\Authentication\emails\activation',
  8. ];

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

  1. public $aliases = [
  2. 'login' => \Myth\Auth\Filters\LoginFilter::class,
  3. 'role' => \agungsugiarto\boilerplate\Filters\RoleFilter::class,
  4. 'permission' => \agungsugiarto\boilerplate\Filters\PermissionFilter::class,
  5. ];

4. Run publish, migrate and seed boilerplate

  1. php spark boilerplate:install

5. Run development server:

  1. php spark serve

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

  1. Default user and password
  2. +----+--------+-------------+
  3. | No | User | Password |
  4. +----+--------+-------------+
  5. | 1 | admin | super-admin |
  6. | 2 | user | super-user |
  7. +----+--------+-------------+

Settings

Config Boilerplate

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

  1. class Boilerplate extends BaseConfig
  2. {
  3. public $appName = 'Boilerplate';
  4. public $dashboard = [
  5. 'namespace' => 'agungsugiarto\boilerplate\Controllers',
  6. 'controller' => 'DashboardController::index',
  7. 'filter' => 'permission:back-office',
  8. ];
  9. // App/Config/Boilerplate.php

Usage

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

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Contributions are very welcome.

License

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