1. Go to this page and download the library: Download amjadiqbal/alertify library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// Display a simple alert
alert(['title' => 'Hello!', 'text' => 'Welcome to Alertify', 'type' => 'success']);
// Display an alert with more options
alert([
'title' => 'Oops...',
'text' => 'Something went wrong!',
'type' => 'error',
'timer' => 3000,
'showCloseButton' => true
]);
public function store(Request $request)
{
// Process the request...
// Display a success message
alert([
'title' => 'Success!',
'text' => 'Your data has been saved.',
'type' => 'success'
]);
return redirect()->back();
}