蜂巢 / core
HoneyComb CMS后端元素包
0.4.15
2019-08-29 10:55 UTC
Requires
- php: ^7.1.3
- barryvdh/laravel-cors: ^0.11.2
- honey-comb/starter: 0.3.*
- laravel/framework: ^5.7
- laravel/passport: ^7.2
- laravel/socialite: ^4.1
Requires (Dev)
- codedungeon/phpunit-result-printer: ^0.26
- mockery/mockery: ^1.0
- orchestra/testbench-browser-kit: ^3.7
- phpunit/phpunit: ^7.0
- dev-master
- 5.7.x-dev
- 5.6.x-dev
- 5.5.x-dev
- 0.4.15
- 0.4.14
- 0.4.13
- 0.4.12
- 0.4.11
- 0.4.10
- 0.4.9
- 0.4.8
- 0.4.7
- 0.4.6
- 0.4.5
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.63
- 0.3.62
- 0.3.61
- 0.3.60
- 0.3.59
- 0.3.58
- 0.3.57
- 0.3.56
- 0.3.55
- 0.3.54
- 0.3.53
- 0.3.52
- 0.3.51
- 0.3.50
- 0.3.49
- 0.3.48
- 0.3.47
- 0.3.46
- 0.3.45
- 0.3.44
- 0.3.43
- 0.3.42
- 0.3.41
- 0.3.40
- 0.3.39
- 0.3.38
- 0.3.37
- 0.3.36
- 0.3.35
- 0.3.34
- 0.3.33
- 0.3.32
- 0.3.31
- 0.3.30
- 0.3.29
- 0.3.28
- 0.3.27
- 0.3.26
- 0.3.25
- 0.3.24
- 0.3.23
- 0.3.22
- 0.3.21
- 0.3.20
- 0.3.19
- 0.3.18
- 0.3.17
- 0.3.16
- 0.3.15
- 0.3.14
- 0.3.13
- 0.3.12
- 0.3.11
- 0.3.10
- 0.3.9
- 0.3.8
- 0.3.7
- 0.3.6
- 0.3.5
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.35
- 0.2.34
- 0.2.33
- 0.2.32
- 0.2.31
- 0.2.30
- 0.2.29
- 0.2.28
- 0.2.27
- 0.2.26
- 0.2.25
- 0.2.24
- 0.2.23
- 0.2.22
- 0.2.21
- 0.2.20
- 0.2.19
- 0.2.18
- 0.2.17
- 0.2.16
- 0.2.15
- 0.2.14
- 0.2.13
- 0.2.12
- 0.2.11
- 0.2.10
- 0.2.9
- 0.2.8
- 0.2.7
- 0.2.6
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.18
- 0.1.17
- 0.1.16
- 0.1.15
- 0.1.14
- 0.1.13
- 0.1.12
- 0.1.11
- 0.1.10
- 0.1.9
- 0.1.8
- 0.1.7
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- dev-dependabot/composer/symfony/http-kernel-4.4.50
- dev-dependabot/composer/guzzlehttp/guzzle-6.5.8
- dev-dependabot/composer/guzzlehttp/psr7-1.8.5
- dev-dependabot/composer/phpseclib/phpseclib-2.0.31
- dev-feature/rich-text-editor
This package is auto-updated.
Last update: 2024-08-30 01:11:37 UTC
README
https://github.com/honey-comb/core
描述
HoneyComb CMS Core包,用于后端元素
注意
这是HoneyComb CMS包的一部分核心包。它需要starter
包。
如果您想使用laravel版本5.6.* 请使用核心包版本0.3.*
要求
- php:
^7.1.3
- laravel:
^5.7
- composer
安装
首先通过Composer安装此包。
{ "require": { "honey-comb/core": "^0.4" } }
或者
composer require honey-comb/core
Laravel集成
要自定义中间件
- 在hc.php文件中添加值到ignoreDefaultMiddleware属性以禁用中间件
'ignoreDefaultMiddleware' => [ ],
- 手动添加中间件到kernel.php
准备
用户
确保更新config/auth.php
中的User控制器
'defaults' => [ 'guard' => 'api', 'passwords' => 'users', ],
'api' => [ 'driver' => 'passport', 'provider' => 'users', ],
'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' => \HoneyComb\Core\Models\HCUser::class, ], ],
'passwords' => [ 'users' => [ 'provider' => 'users', 'table' => 'hc_user_password_reset', 'expire' => 60, ], ],
处理器
确保在app/Exceptions/Handler.php
中使用异常处理器特性
<?php namespace App\Exceptions; use HoneyComb\Core\Exceptions\Traits\HCExceptionHandlerTrait; class Handler extends ExceptionHandler { use HCExceptionHandlerTrait; }
数据库
我们推荐使用utf8mb4_unicode_520_ci
校对,因此您可以在config/database.php
中更新它
'collation' => 'utf8mb4_unicode_520_ci'
Passport安装
迁移
- 在
AppServiceProvider
的register()
方法中添加\Laravel\Passport\Passport::ignoreMigrations();
- 发布迁移
php artisan vendor:publish --tag=passport-migrations
- 将表中的
user_id
字段更新为uuid
,例如$table->integer('user_id');
->$table->uuid('user_id');
oauth_auth_codes
oauth_access_tokens
oauth_clients
安装
php artisan passport:install
命令
移除默认的Laravel用户迁移(如果是全新项目)
2014_10_12_000000_create_users_table.php
2014_10_12_100000_create_password_resets_table.php
运行Artisan命令
php artisan migrate
php artisan hc:seed
php artisan hc:permissions
php artisan hc:forms
php artisan hc:admin-menu
php artisan hc:super-admin