app/Http/Requests/PermissionStoreRequest.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(Request $request)
    {
        if($request->status == 1) {
            return [
                'name' => 'required|min:2',
                'icon' => 'required',
                'path' => 'required',
                'status'  => 'required|boolean',
                'method'  => 'required',
                'p_id'  => 'required',
                'hidden'  => 'required',
            ];
        } else{
            return [
                'name' => 'required|min:2',
                'url' => 'required',
                'method'  => 'required',
                'p_id'  => 'required',
                'hidden'  => 'required',
            ];
        }
    }
public function rules ( Request $ request ) { if ( $ request -> status == 1 ) { return [ 'name' => 'required|min:2' , 'icon' => 'required' , 'path' => 'required' , 'status' => 'required|boolean' , 'method' => 'required' , 'p_id' => 'required' , 'hidden' => 'required' , ] ; } else { return [ 'name' => 'required|min:2' , 'url' => 'required' , 'method' => 'required' , 'p_id' => 'required' , 'hidden' => 'required' , ] ; } }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .