realrashid/sweet-alert
Laravel package to integrate SweetAlert2 popups: stylish alerts, confirmations, toasts, and notifications. Trigger from controllers or views with simple helpers and session flashes, customize options, and improve UX with minimal setup.
Import Alert Facade first!
use RealRashid\SweetAlert\Facades\Alert;
or
Use Alert;
in your controller method
Alert::alert('Title', 'Message', 'Type');
Alert::success('Success Title', 'Success Message');
Alert::info('Info Title', 'Info Message');
Alert::warning('Warning Title', 'Warning Message');
Alert::error('Error Title', 'Error Message');
Alert::question('Question Title', 'Question Message');
Alert::image('Image Title!','Image Description','Image URL','Image Width','Image Height', 'Image Alt');
Alert::html('Html Title', 'Html Code', 'Type');
Alert::toast('Toast Message', 'Toast Type');
Set the Default Toast Position in
config/sweetalert.phpfile OR use theposition()helper method!
alert('Title','Lorem Lorem Lorem', 'success');
alert()->success('Title','Lorem Lorem Lorem');
alert()->info('Title','Lorem Lorem Lorem');
alert()->warning('Title','Lorem Lorem Lorem');
alert()->error('Title','Lorem Lorem Lorem');
alert()->question('Title','Lorem Lorem Lorem');
alert()->image('Image Title!','Image Description','Image URL','Image Width','Image Height', 'Image Alt');
alert()->html('<i>HTML</i> <u>example</u>'," You can use <b>bold text</b>, <a href='//github.com'>links</a> and other HTML tags ",'success');
toast('Your Post as been submited!','success');
Set the Default Toast Position in
config/sweetalert.phpfile OR use theposition()helper method!
How can I help you explore Laravel packages today?