I set up a controller to pass errors if validation fails and another message if passed it.
if ($v->fails()) {
return redirect('tickets/create')->withInput()->withErrors($v->errors());
} else {
$ticket_id = $this->salvataggio($request);
return redirect('tickets/' . $ticket_id . '/edit')
->with(['status' => 'success']);
}
In the blade file of the view, I can read the error variable but I can't read the status.
@if(Session::has('status'))
<div class="alert alert-success">{{Session::get('status')}}</div>
@endif
I have read and tried many methods to retrieve Session but it seems doesn't work. I've already used this method on a previous project with Laravel 5 but in this version (8.11.0), has something has changed?