SHARE
TWEET

Untitled

a guest Jun 27th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <form method="POST" action="some_url">
  2.   <input name="_method" type="hidden" value="PATCH">
  3.   <input type="hidden" name="_token" value="{{ csrf_token() }}">
  4.   <input name="job_title" type="text" value="{{isset($profile->job_title) ? $profile->job_title : old('job_title') }}" class="form-control">
  5.   <button type="submit">Submit</button>
  6. </form>
  7.      
  8. class ProfileRequest extends FormRequest {
  9.  
  10.  
  11.     public function authorize()
  12.     {
  13.        return true;
  14.     }
  15.  
  16.  
  17.     public function rules()
  18.     {
  19.        return = [  
  20.            'job_title' => 'required|max:100',
  21.        ];
  22.     }
  23.  
  24.  
  25.     protected function failedValidation(Validator $validator)
  26.     {
  27.  
  28.        throw (new ValidationException($validator))
  29.         ->errorBag($this->errorBag)
  30.         ->redirectTo($this->getRedirectUrl());
  31.     }
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top