Did you also install the Sweet Alert JavaScript library trough NPN or Yarn as is stated in the documentation?
Do you get any errors? Did you check the console tab in the Chrome Inspector?
guys iam working with a project
iam using flash message in my controller
this is my controller
Session::flash('success','Location Data Entered succesfully');
return redirect()->route('Location_details.create');
this is my message
@if(Session::has('success'))
<div class="alert alert-success">
<strong>Success: </strong>{{ Session::get('success') }}
</div>
@endif
But now i need to use sweet alert instead of flash messages.
How to use that,
i did this
composer require uxweb/sweet-alert
'providers' => [
....
UxWeb\SweetAlert\SweetAlertServiceProvider::class,
],
'aliases' => [
....
'Alert' => UxWeb\SweetAlert\SweetAlert::class,
]
And atlast i changed my controller to
Alert::message('Location data entered succesfully!');
return redirect()->route('Location_details.create');
in the header i added
use Alert
But its not working.
whats the problem how can i use sweet alerts in my controller
Kindly some one suggest
@martinbean and @MThomas thankz for your response it worked.
based on your suggestions i did this
first i included the CDN in my layout.app
and the i added the alert message in my controller
and then i included @include('sweet::alert') this in my view.blade page which i redirected after the adding or deleting process is done..
Please or to participate in this conversation.