Displaying the Error Messages in Laravel after being Redirected from controller

后端 未结 9 1131
情书的邮戳
情书的邮戳 2020-12-13 01:44

How can I display the validation message in the view that is being redirected in Laravel ?

Here is my function in a Controller

publi         


        
相关标签:
9条回答
  • 2020-12-13 02:21
    @if ($errors->has('category'))
        <span class="error">{{ $errors->first('category') }}</span>
    @endif
    
    0 讨论(0)
  • 2020-12-13 02:22
    {!! Form::text('firstname', null !!}
    
    @if($errors->has('firstname')) 
        {{ $errors->first('firstname') }} 
    @endif
    
    0 讨论(0)
  • 2020-12-13 02:32

    A New Laravel Blade Error Directive comes to Laravel 5.8.13

    // Before
    @if ($errors->has('email'))
        <span>{{ $errors->first('email') }}</span>
    @endif
    
    // After:
    @error('email')
        <span>{{ $message }}</span>
    @enderror
    
    0 讨论(0)
提交回复
热议问题