https://github.com/honey-comb/core
HoneyComb CMS Core package for backend elements
This is part core package HoneyComb CMS package. It require starter
package.
If you want to use laravel version 5.6.* use core package version 0.3.*
- php:
^7.1.3
- laravel:
^5.7
- composer
Begin by installing this package through Composer.
{
"require": {
"honey-comb/core": "^0.4"
}
}
or
composer require honey-comb/core
To customize middleware:
- disable middleware in hc.php file adding value to ignoreDefaultMiddleware property
'ignoreDefaultMiddleware' => [ ],
- manualy add middleware to kernel.php
Make sure to update the User controller in config/auth.php
'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,
],
],
Make sure to use a exceptions handler trait in app/Exceptions/Handler.php
<?php
namespace App\Exceptions;
use HoneyComb\Core\Exceptions\Traits\HCExceptionHandlerTrait;
class Handler extends ExceptionHandler
{
use HCExceptionHandlerTrait;
}
We recomend to use utf8mb4_unicode_520_ci
collation, so you can update it in config/database.php
'collation' => 'utf8mb4_unicode_520_ci'
- In
AppServiceProvider
register()
method add\Laravel\Passport\Passport::ignoreMigrations();
- publish migrations
php artisan vendor:publish --tag=passport-migrations
- update
user_id
fields touuid
e.g.$table->integer('user_id');
->$table->uuid('user_id');
in tables:oauth_auth_codes
oauth_access_tokens
oauth_clients
php artisan passport:install
Remove default Laravel user migrations (if it is a clean project)
2014_10_12_000000_create_users_table.php
2014_10_12_100000_create_password_resets_table.php
Run Artisan commands
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