Skip to content
Emeka Mbah edited this page Jun 28, 2023 · 14 revisions

Welcome to the alert wiki!

Alert is a Laravel package for displaying different types of messages in Laravel application views. It's designed to make flashing messages in Laravel Applications a breeze, with a lot of easy-to-use and fluent methods.

The alert is pretty easy to use, customize and extend. There are 6 out-of-box alert types, fortunately, you can easily create custom types.

Message Alert

   Alert::message('Welcome! Please complete your profile')
   ->info()
   ->flash();
image

Sticky Alert

   Alert::sticky('Your subscription has expired and we are unable to charge your credit card')
   ->title('Billing')
   ->action('Yes', '/')
   ->tag('contact')
   ->warning()
   ->flash();

Then much later from anywhere

Alert::stickForget('contact')
image

Field Alert

  Alert::field('Username looks good')
  ->name('username')
  ->tag('login')
  ->success()
  ->flash();
        
  Alert::field('Password looks bad')
  ->name('password')
  ->tag('login')
  ->error()
  ->flash();
Untitled

FieldBag Alert

   $validator = validator(
       [
          'username' => '', 
          'password' => 'pass'
       ], 
       [
          'username' => 'required', 
          'password' => 'required|min:6'
       ]
   );

   Alert::fieldBag($validator)
   ->error()
   ->flash();
image

Modal Alert

  Alert::modal('Your message has been received, you will hear from us soon')
     ->title('Thanks!')
     ->action('Yes')
     ->cancel('Cancel')
     ->centered()
     ->large()
     ->success()
     ->flash();
image

Notify Alert

  Alert::notify('Some errors occurred!')
  ->title('Opps!')
  ->bottomRight()
  ->tag('contact')
  ->error()
  ->flash();
image
Clone this wiki locally