jlunieffendi/eofficeboilerplate

eoffice 的样板

v0.2 2023-01-18 07:05 UTC

This package is auto-updated.

Last update: 2024-09-18 10:43:17 UTC


README

CodeIgniter 4 应用程序样板

此包为 CodeIgniter 4 提供了一个快速创建后台应用程序的基本平台。它包括个人资料创建和管理、用户管理、角色、权限以及动态生成的菜单。

特性

该项目仍处于早期开发阶段...请随时贡献!

屏幕截图 | 在 Heroku 上演示

Dashboard

安装

1. 获取模块

composer require agungsugiarto/boilerplate

2. 根据您的现有数据库设置您的 .env 文件中的 CI_ENVIRONMENT、baseURL、首页和数据库配置(如果您没有 .env 文件,您可以从 env 文件中复制第一个:cp env .env)。如果数据库不存在,请先创建数据库。

# .env file
CI_ENVIRONMENT = development

app.baseURL = 'https://:8080'
app.indexPage = ''

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

3. 运行 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

注意:有关如何配置 auth 的所有信息,您可以在 Myth/Auth 中找到。

准备好了吗?别急!! ;-) 在发布 Config/Auth.php 之后,您需要更改以下 public $views

public $views = [
    'login'           => 'julianeffendi\eofficeboilerplate\Views\Authentication\login',
    'register'        => 'julianeffendi\eofficeboilerplate\Views\Authentication\register',
    'forgot'          => 'julianeffendi\eofficeboilerplate\Views\Authentication\forgot',
    'reset'           => 'julianeffendi\eofficeboilerplate\Views\Authentication\reset',
    'emailForgot'     => 'julianeffendi\eofficeboilerplate\Views\Authentication\emails\forgot',
    'emailActivation' => 'julianeffendi\eofficeboilerplate\Views\Authentication\emails\activation',
];

打开 app\Config\Filters.php,找到 $aliases 并添加以下行

public $aliases = [
    'login'      => \Myth\Auth\Filters\LoginFilter::class,
    'role'       => \julianeffendi\eofficeboilerplate\Filters\RoleFilter::class,
    'permission' => \julianeffendi\eofficeboilerplate\Filters\PermissionFilter::class,
];

4. 运行 publish、migrate 和 seed 样板

php spark boilerplate:install

5. 运行开发服务器

php spark serve

6. 在浏览器中打开 https://:8080/admin

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

设置

配置样板

您可以在 app\Config\Boilerplate.php 中配置默认仪表板控制器和后台主题

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

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

用法

您可以通过阅读代码路由、控制器和视图等了解它是如何工作的。最后...快乐的编码!

变更日志

请参阅 CHANGELOG 了解最近更改的更多信息。

贡献

欢迎贡献。

许可证

此包是免费软件,根据 MIT 许可证 的条款分发。