Wyświetlanie komunikatu o błędzie od kontrolera, aby wyświetlić laravel 8

Przykłady kodu

5
0

komunikat o błędzie wyświetlania laravel

@if(count($errors) > 0 )
<div class="alert alert-danger alert-dismissible fade show" role="alert">
    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
        <span aria-hidden="true">&times;</span>
    </button>
    <ul class="p-0 m-0" style="list-style: none;">
        @foreach($errors->all() as $error)
        <li>{{$error}}</li>
        @endforeach
    </ul>
</div>
@endif
1
0

komunikat o zwrot kontrolera laravel

#In Controller
use Session;
       
Session::flash('message', "Special message goes here");
return Redirect::back();

#In View
@if (Session::has('message'))
   <div class="alert alert-info">{{ Session::get('message') }}</div>
@endif

Podobne strony

Podobne strony do przykłady

W innych językach

Ta strona jest w innych językach

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................