Skip to content

plusemon/notify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

Toastr JS Alert Notification System for PHP/Laravel

1. Install

composer require plusemon/notify

2. Add resources

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Laravel Notify</title>
    <link rel="stylesheet" href="https://cdn.bootcss.com/toastr.js/latest/css/toastr.min.css" />
</head>

<body>

<!-- Main Contents -->
<h1>Laravel Toastr Notify Notification</h1>

<!-- jQuery CDN -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>

<!-- Toastr script CDN -->
<script src="https://cdn.bootcss.com/toastr.js/latest/js/toastr.min.js"></script>

<!-- Toastr Scripts render -->
{!! Notify::message() !!}

</body>

</html>

3. Usage

<!--  Example   -->
Notify::success('You have successfully added Notify alert system');
notify()->info('Info message with helper function');

<!--  Using Facade    -->
Notify::info('message', 'title', ['options']);
Notify::success('message', 'title', ['options']);
Notify::warning('message', 'title', ['options']);
Notify::error('message', 'title', ['options']);

<!--   Clear   -->
Notify::clear();

return Notify::info('Info redirect back with message by helper function')->back(); return notify()->info('Info redirect with message by helper function')->redirect('/');

You have successfully installed notify system. 😃

Configuration

Add the service provider to config/app.php

Plusemon\Notify\NotifyServiceProvider::class,

Optionally include the Facade in config/app.php if you'd like.

'Notify'  => Plusemon\Notify\Facades\Notify::class,

Options

Publish the config file

php artisan vendor:publish --provider=Plusemon\Notify\NotifyServiceProvider

For More visit toastr's documentation to custom your need.

Dependencies

jQuery toast, you need to add css and js to your html.

MIT

About

Flexible Toastr JS Alert System for PHP/Laravel.

Topics

Resources

Stars

Watchers

Forks

Languages