Installed laravel-permission and laravel-modules

This commit is contained in:
Gregorio Chiko Putra
2018-07-30 09:26:17 +07:00
parent 70fe3a814c
commit eee570125d
86 changed files with 23539 additions and 253 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
use App\Role;
class UpdateRole extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return Auth::user()->can('update-role');
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
$id = $this->role;
return Role::getUpdateRulesForId($id);
}
}