Ready to show your first notification? Let's go!
The easiest way to use Flare is through the Flare facade. You can call it from any Livewire component or Controller.
use AlizHarb\Flare\Facades\Flare;
class UserProfile extends Component
{
public function update()
{
// ... update logic ...
Flare::success('Profile updated successfully!');
}
}
Flare comes with 4 built-in notification types, each with its own distinct visual style.
You can add a bold title (heading) to any notification to give it more context:
Flare::success(
text: 'Your changes have been saved.',
heading: 'Success!'
);
By default, toasts disappear after 5 seconds. You can change this per toast:
Flare::info(
text: 'I will stay for 10 seconds.',
duration: 10000 // milliseconds
);
[!TIP] To make a toast persistent (never auto-dismiss), set duration to
0.
Flare::error(
text: 'Network error. Please try again.',
duration: 0
);
How can I help you explore Laravel packages today?