Skip to content
On this page

Flash notifications


By default, flash notifications are globally shared and persisted. You can access them using useProperty or useProperties.

const properties = useProperties()
// properties.flash

const flash = useProperty('flash')
// flash.value.error
// flash.value.success
// flash.value.warning

Just like with Blade, flash notifications are only available for the current request, after which they are discarded.

As a reminder, you can create a flash notification by using response()->with() or session()->flash():

return back()->with('success', 'Lorem ipsum dolor sit amet.');

Disabling default flashes

If you don't want flash notifications or prefer a custom implementation, you may disable this feature by adding the shareFlashNotifications to your middleware.

class HandleHybridRequests extends Middleware
    protected bool $shareFlashNotifications = false;

    // ...