コード例 #1
0
ファイル: UpdateRoleRequest.php プロジェクト: ARCANESOFT/Auth
 /**
  * Get the validation rules that apply to the request.
  *
  * @return array
  */
 public function rules()
 {
     /** @var \Arcanesoft\Auth\Models\Role $role */
     $role = $this->route('auth_role');
     return array_merge(parent::rules(), ['slug' => "required|min:3|unique:roles,slug,{$role->id}"]);
 }
コード例 #2
0
ファイル: CreateRoleRequest.php プロジェクト: arcanesoft/auth
 /**
  * Get the validation rules that apply to the request.
  *
  * @return array
  */
 public function rules()
 {
     return array_merge(parent::rules(), ['slug' => 'required|min:3|unique:roles,slug']);
 }