app/maguttiCms/Admin/Requests/AdminFormRequest.php
/**
     * Get the validation rules that
     * apply to the request.
     *
     * @return array
     */
Get the validation rules that
apply to the request.

@return array
Get the validation rules that apply to the request . @return array
public function rules()
    {
        $obj = $this->getModelObject();
        foreach ($obj->getFieldspec() as $key => $field) {
            if (data_get($field, 'validation') != '') {
                $this->handleValidationRules($field['validation'], $key);
            } else if (data_get($field, 'required') && in_array($key, $obj->getFillable())) {
                $this->addRule($key);
            }
        }
        return $this->rules;
    }
public function rules ( ) { $ obj = $ this -> getModelObject ( ) ; foreach ( $ obj -> getFieldspec ( ) as $ key => $ field ) { if ( data_get ( $ field , 'validation' ) != '' ) { $ this -> handleValidationRules ( $ field [ 'validation' ] , $ key ) ; } else if ( data_get ( $ field , 'required' ) && in_array ( $ key , $ obj -> getFillable ( ) ) ) { $ this -> addRule ( $ key ) ; } } return $ this -> rules ; }
Get the validation rules that
 apply to the request.
Get the validation rules that apply to the request .