Run in project directory:
composer require scary-layer/hush
php artisan vendor:publish --tag=hush --force
- be careful, it may replace some of your existing files.Flag --force
needed to replace the DatabaseSeeder file. So you may not use it and replace this file manually.
php artisan migrate --seed
- it will also create dev, admin and simple user.ScaryLayer\Hush\Traits\Permissiable
trait by your User model.role
to fillable array.You should have something like:
<?php
namespace App;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use ScaryLayer\Hush\Traits\Permissiable;
class User extends Authenticatable
{
use Notifiable;
use Permissiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password', 'role'
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'email_verified_at' => 'datetime',
];
}
If you encounter any problems, please, notify us.
You can do that by creating an issue or by sending email to maintainer.