{{-- ?alert (optional): * alert_type need set, if you have multiple alerts on a single template and you need to show only one alert. Include in Blade: @includeIf('flash_message', ['alert_type' => 'group']) Include in Controller: return redirect()->route('rights_and_groups') ->with('success', "Gruppe " .$request->name ." wurde erfolgreich gespeichert") ->with('alert', "group"); *------------------------------------------------------------------------------------------------------------------------- ?alert_speed (optional): * alert speed is estimated reading time from content of the << $message >> parameter. Minimum reading time is 3000 ms by default or as postet << $alert_speed >>. Include in Blade: // not required Include in Controller: return redirect()->route('rights_and_groups') ->with('success', "Gruppe " .$request->name ." wurde erfolgreich gespeichert") ->with('$alert_speed', 3000); *------------------------------------------------------------------------------------------------------------------------- --}} @if (isset($alert_type) && Session::get('alert') === $alert_type || !isset($alert_type)) @php $alert_speed = Session::get('alert_speed') ?? 3000; $persistant = Session::get('persistant') ? true : false; @endphp {{-- {{ dd( Session::get('alert') ) }} --}} @if ($message = Session::get('success')) @php $estimated_reading_time = estimated_reading_time($message, 'ms'); @endphp @endif @if ($message = Session::get('error')) @php $estimated_reading_time = estimated_reading_time($message, 'ms'); @endphp @endif @if ($message = Session::get('warning')) @php $estimated_reading_time = estimated_reading_time($message, 'ms'); @endphp @endif @if ($message = Session::get('info')) @php $estimated_reading_time = estimated_reading_time($message, 'ms'); @endphp @endif @if ($errors->any()) @endif @if(isset($estimated_reading_time)) @php $alert_speed = $estimated_reading_time > $alert_speed ? $estimated_reading_time : $alert_speed; @endphp @endif @endif