Guest User

Untitled

a guest
Jul 17th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. $rules =array(
  2. 'name' => 'required'
  3. );
  4. $validator = Validator::make(Input::all(), $rules);
  5. //process
  6. if($validator->fails()){
  7. return Redirect::to('testcategory/create')->withErrors($validator);
  8. }
  9.  
  10. @if($errors->any())
  11. {{ $errors->first('name') }}
  12. @endif
  13.  
  14. object(IlluminateSupportViewErrorBag)#91 (1) { ["bags":protected]=> array(1) {
  15. ["default"]=> object(IlluminateSupportMessageBag)#92 (2)
  16. { ["messages":protected]=> array(1)
  17. { ["name"]=> array(1) { [0]=> string(27) "The name field is required." } }
  18. ["format":protected]=> string(8) ":message" } } }
  19.  
  20. {{ $errors->getBag('default')->first('name') }}
  21.  
  22. Route::group(['middleware' => ['web']], function() {
  23. Route::get('/home', 'HomeController@index')->name('home');
  24. });
Add Comment
Please, Sign In to add comment