<?php
namespace QxCMS\Modules\Client\Requests\Settings;
use Illuminate\Foundation\Http\FormRequest;
class RoleRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'name' => 'required|min:3|unique:client.roles,name,'.($this->getId() ? $this->getId():NULL).',id',
'display_name' => 'required|min:3'
];
}
public function getId()
{
return decode($this->role);
}
}