Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $rules =array(
- 'name' => 'required'
- );
- $validator = Validator::make(Input::all(), $rules);
- //process
- if($validator->fails()){
- return Redirect::to('testcategory/create')->withErrors($validator);
- }
- @if($errors->any())
- {{ $errors->first('name') }}
- @endif
- object(IlluminateSupportViewErrorBag)#91 (1) { ["bags":protected]=> array(1) {
- ["default"]=> object(IlluminateSupportMessageBag)#92 (2)
- { ["messages":protected]=> array(1)
- { ["name"]=> array(1) { [0]=> string(27) "The name field is required." } }
- ["format":protected]=> string(8) ":message" } } }
- {{ $errors->getBag('default')->first('name') }}
- Route::group(['middleware' => ['web']], function() {
- Route::get('/home', 'HomeController@index')->name('home');
- });
Add Comment
Please, Sign In to add comment