1. Go to this page and download the library: Download mckenziearts/laravel-notify 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/ */
mckenziearts / laravel-notify example snippets
public function store()
{
notify()
->success()
->title('⚡️ Laravel Notify is awesome!')
->send();
return back();
}
notify()
->success()
->title('Welcome to Laravel Notify ⚡️')
->send();
public function destroy(User $user)
{
$user->delete();
notify()
->success()
->title('User deleted')
->message('The user has been moved to trash')
->actions([
NotifyAction::make()
->label('Undo')
->action(route('users.restore', $user->id))
->method('POST'),
NotifyAction::make()
->label('View Trash')
->url(route('users.trash'))
->openUrlInNewTab(),
])
->send();
return redirect()->route('users.index');
}