lopatin96 / laravel-alert
Laravel alert
Installs: 7 866
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Blade
Requires
- php: >=8.0
Requires (Dev)
- orchestra/testbench: ^8.0
README
Include alert component in resources/views/components/banner
:
<x-laravel-alert::alert />
Add alert component to resources/views/layouts/app.blade.php
:
<body class="font-sans antialiased"> @include('laravel-subscription::subscription.info') <div class="min-h-screen bg-gray-100"> @livewire('navigation-menu') <x-banner /> …
Display message in alert:
session(['flash.banner' => __('alerts.test')]); // or return redirect('dashboard')->with([ 'flash.banner' => __('alerts.test'), 'flash.bannerStyle' => 'success', ]);
Set danger style to the banner:
session(['flash.bannerStyle' => 'danger']); // or session(['flash.bannerStyle' => 'success']);
Publishing
Views
php artisan vendor:publish --tag="laravel-alert-views"