Laravel 5.2 validation errors

后端 未结 9 745
隐瞒了意图╮
隐瞒了意图╮ 2020-11-30 06:41

I have some trouble with validation in Laravel 5.2 When i try validate request in controller like this

$this->validate($request, [
                \'title         


        
9条回答
  •  孤街浪徒
    2020-11-30 07:24

    // Controller
    $this->validateWith([
        'title' => 'required',
        'content.*.rate' => 'required',
    ]);
    
    
    // Blade Template
    @if ($errors->has('title'))
        
            {{ $errors->first('title') }}
        
    @endif
    @if ($errors->has('anotherfied'))
        
            {{ $errors->first('anotherfied') }}
        
    @endif
    

    Find the documentation.

提交回复
热议问题