jeudi 29 août 2019

how can i pass custom message to blade from controller

i have this in my blade

 <input id="name" type="text"
                           class="form-control @error('name') is-invalid @enderror" name="name"
                           value="" autocomplete="name" autofocus>
                     @error('name')
                       <span class="invalid-feedback" role="alert">
                            <strong></strong>
                       </span>
                    @enderror

and i would like to pass this through my controller

 catch (\Exception $e){
 return back()->withError('name','Somthing Went Wrong Please Try Again!');
                }

but it does not work how can i fix this



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2HyUSPT
via IFTTT

Aucun commentaire:

Enregistrer un commentaire