Laravel Notify is a package that lets you add custom notifications to your project.A diverse range of notification design is available.
Version | Laravel version | Status | Branch | Install |
---|---|---|---|---|
1.x | 5.5, 5.6, 5.7, 6.0 | EOL | 1.0 | composer require mckenziearts/laravel-notify 1.* |
2.x | >= 7.0 | Latest | 2.0 | composer require mckenziearts/laravel-notify |
If you need Android version please try this package Aesthetic Dialogs. Happy Coding ������
You can install the package using composer
$ composer require mckenziearts/laravel-notify
Then add the service provider to config/app.php
. In Laravel versions 5.5 and beyond, this step can be skipped if package auto-discovery is enabled.
'providers' => [
...
Mckenziearts\Notify\LaravelNotifyServiceProvider::class
...
];
You can publish the configuration file and assets by running:
$ php artisan vendor:publish --provider="Mckenziearts\Notify\LaravelNotifyServiceProvider"
Now that we have published a few new files to our application we need to reload them with the following command:
$ composer dump-autoload
@notifyCss
@notifyJs
notify()
helper function inside your controller to set a toast notification for info, success, warning or error@include('notify::components.notify')
If you are on Laravel 7 or greater, you can use the tag syntax.
<x:notify-messages />
Within your controllers, before you perform a redirect call the notify
method with a message.
public function store()
{
notify()->success('Laravel Notify is awesome!');
return Redirect::home();
}
An complete example:
<!doctype html>
<html>
<head>
<title>Laravel Notify</title>
@notifyCss
</head>
<body>
@include('notify::messages')
// Laravel 7 or greater
<x:notify-messages />
@notifyJs
</body>
</html>
Laravel Notify actually display 5 types of notifications
toast
notification, (The default notification for Laravel Notify)notify()->success('Welcome to Laravel Notify ⚡️') or notify()->success('Welcome to Laravel Notify ⚡️', 'My custom title')
connectify
notification, example of basic usageconnectify('success', 'Connection Found', 'Success Message Here')
drakify
(
drakify('success') // for success alert
or
drakify('error') // for error alert
smilify
notification, displays a simple custom toast notification using the smiley (
smilify('success', 'You are successfully reconnected')
emotify
notification, displays a simple custom toast notification using a vector emoticonemotify('success', 'You are awesome, your data was successfully created')
If you have a specific notification that is used across multiple different places in your system, you can define itas a preset notification in your config file. This makes it easier to maintain commonly used notifications in one place.Read how to define preset messages in the Config section below.
As an example, to use a preset notification you have defined called 'common-notification', use the following:
notify()->preset('common-notification')
You can override any of the values that are set in the config if you need to. For example, this could be useful if youhave a common notification across, but you want to change the icon in one particular place that it's used without havingto manually write out a new notification.
To do this, simply pass in an array that has the key of the attribute that you want to override and the value you wantto override it with.
As an example, we could override the 'title' of our 'common-notification' by using the following:
notify()->preset('common-notification', ['title' => 'This is the overridden title'])
Config file are located at config/notify.php
after publishing provider element.
Some awesome stuff. To active dark mode
update the theme
config, or add global variable NOTIFY_THEME
on your .env file
'theme' => env('NOTIFY_THEME', 'dark'),
You can define preset notifications in the config file using the following structure:
'preset-messages' => [
'user-updated' => [
'message' => 'The user has been updated successfully.',
'type' => 'success',
'model' => 'connect',
'title' => 'User Updated',
],
'user-deleted' => [
'message' => 'The user has been deleted successfully.',
'type' => 'success',
'model' => 'connect',
'title' => 'User Deleted',
],
],
The example above shows the config for two preset notifications: 'user-updated' and 'user-deleted'.
Please see the changelog for more information on what has changed recently.
Please see contributing.md for details and a todolist.
If you discover any security related issues, please email author email instead of using the issue tracker.
If you use and enjoy Laravel Notify you can encourage the author by
Donation made with love by Charlie from United Kingdom
- 9 October 2020license. Please see the license file for more information.
Laravel-Admin 自定义操作按钮大全(表格工具区域、行内操作按钮) 一、行内操作按钮 1、单行操作 行内操作按钮-单行操作共需要三步: 生成操作类 编辑操作类 加入到表格 生成操作类 php atisan admin:action Copy --grid-row --name="复制" 编辑操作类 <?php namespace App\Admin\Actions; use En
git地址: http://packagist.p2hp.com/packages/yansongda/laravel-pay 具体使用说明请传送至 https://github.com/yansongda/pay 快速实现微信公众号支付功能 :https://www.jianshu.com/p/9c322b1a5274 运行环境 php >= 7.0 composer laravel || lu
网上现有许多laravel的微信支付都是以前的版本,我就把新的捋一遍啊。 composer中配置的是 "overtrue/laravel-wechat": "^4.0", 基础配置不说了,网上都有,说一下使用吧。 jssdk: public function getJssdk(Request $request) { $app = new Application(ge
安装 composer require zgldh/qiniu-laravel-storage:0.10.3 去config/app.php 里面的 providers 数组, 加上一行,注册服务提供者 zgldh\QiniuStorage\QiniuFilesystemServiceProvider::class 去config/filesystem.php 里面的 disks数组加上,配置
README php >= 7.3 composer laravel || lumen >= 8.0 一. 下载支付相关的依赖包 packagist.org中搜索 yansongda/laravel-pay 地址: yansongda/laravel-pay - Packagist 使用2.3.0这个版本, 后续对这个比较熟悉再根据文档去使用最新的 composer require yanson
微信通知 在VerifyCsrfToken文件里面添加微信通知地址,表示这个这地不用验证 <?php namespace App\Http\Middleware; use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware; class VerifyCsrfToken extends Middleware {
框架要求: Laravel/Lumen >= 5.1 安装 # Laravel < 5.8 composer require "overtrue/laravel-wechat:~4.0" -vvv # Laravel >= 5.8 composer require "overtrue/laravel-wechat:~5.0" -vvv 配置 Laravel 应用 1,在 config/
项目里需要导入了,正好 3.1 版本,也支持导入了,补充下 excel 导入的翻译文档。(工作比较忙,大概过了一遍,可能有不少错误的地方) 1.5分钟快速入门 在 app/Import 创建一个导入类 php artisan make:import UsersImport --model=User 会在 app/Imports 发现新创建的文件: . ├── app │
我计划用vuex+laravel构建一个应用,采用的是vuex的架构方式,同时,我找到了一个组件laravel-elixir-webpack,我想借用这个组件继续使用laravel里面的elixir来完成vue组件的编译。 这是我的package.json,这个基本是照搬vuex的package.json { "private": true, "scripts": { "prod": "gulp
在本文中,我们将探索Laravel Web框架中的通知系统。 Laravel中的通知系统允许您通过不同的渠道向用户发送通知。 今天,我们将讨论如何通过邮件通道发送通知。 通知基础 在应用程序开发期间,您通常需要将不同的状态更改通知用户。 出于安全目的,可能是在更改订单状态时发送电子邮件通知,或者是发送有关其登录活动的SMS。 特别是,我们谈论的是简短的消息,只是提供对状态更改的洞察力。 Larav
Laravel 是一套简洁、优雅的PHP Web开发框架(PHP Web Framework)。它可以让你从面条一样杂乱的代码中解脱出来;它可以帮你构建一个完美的网络APP,而且每行代码都可以简洁、富于表达力。 功能特点 1、语法更富有表现力 你知道下面这行代码里 “true” 代表什么意思么? $uri = Uri::create(‘some/uri’, array(), array(), tr
我需要空间/Laravel权限的帮助。当我试图分配它给我错误哎呀,看起来像出了问题。 错误 Connection.php第761行中的QueryExcema:SQLSTATE[23000]:完整性约束冲突:1048列role_id不能为空(SQL:插入到(,)值(9,))
Laravel 作为现在最流行的 PHP 框架,其中的知识较多,所以单独拿出来写一篇。 简述 Laravel 的生命周期 Laravel 采用了单一入口模式,应用的所有请求入口都是 public/index.php 文件。 注册类文件自动加载器 : Laravel通过 composer 进行依赖管理,无需开发者手动导入各种类文件,而由自动加载器自行导入。 创建服务容器:从 bootstrap/ap
简介 Laravel Scout 为 Eloquent 模型 全文搜索提供了简单的,基于驱动的解决方案。通过使用模型观察者,Scout 会自动同步 Eloquent 记录的搜索索引。 目前,Scout 自带一个 Algolia 驱动;不过,编写自定义驱动很简单, 你可以轻松的通过自己的搜索实现来扩展 Scout。 安装 首先,通过 Composer 包管理器来安装 Scout: composer
简介 Laravel 致力于让整个 PHP 开发体验变得愉快, 包括你的本地开发环境。 Vagrant 提供了一种简单,优雅的方式来管理和配置虚拟机。 Laravel Homestead 是一个官方预封装的 Vagrant box,它为你提供了一个完美的开发环境,而无需在本地机器安装 PHP 、Web 服务器和其他服务器软件。不用担心会搞乱你的操作系统!Vagrant boxes 是一次性的。如果
WebStack-Laravel 一个开源的网址导航网站项目,具备完整的前后台,您可以拿来制作自己的网址导航。 部署 克隆代码: git clone https://github.com/hui-ho/WebStack-Laravel.git 安装依赖: composer installphp artisan key:generate 编辑配置: cp .env.example .env ...D
百度编辑器 For Laravel 5 支持自定义路由, 默认前后台独立控制器,支持重写方法方便自己的业务逻辑处理,支持扩展图片助手(推荐使用Intervention\Image第三方包) 官网 NinJa911工作室. 疑问讨论 请在issue里new一个. 授权 此Laravel 扩展包基于MIT协议开源MIT license. 安装 1.Composer 安装 composer requir
laravel-admin是一个基于laravel的后台管理开发框架,能帮助你使用很少的时间和代码量开发出功能完备的管理后台,另外它作为一个三方包,可以和框架内其它项目并行开发,真正做到前后台开发分离。 功能: RBAC权限管理模块。 菜单管理,和权限系统结合。 模型数据表格,能快速构建数据表格,并支持多种模型关系。 模型表单以及30+种form元素组件,自动实现增、删、改功能。 支持本地和云存储