REBELinBLUE\Deployer\Http\Requests\StoreGroupRequest::rules PHP Method

rules() public method

Get the validation rules that apply to the request.
public rules ( ) : array
return array
    public function rules()
    {
        $rules = ['name' => 'required|max:255|unique:groups,name'];
        // On edit add the group ID to the rules
        if ($this->get('id')) {
            $rules['name'] .= ',' . $this->get('id');
        }
        return $rules;
    }
StoreGroupRequest