定制 kapouet/laravel-notyf 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kapouet/laravel-notyf

Composer 安装命令:

composer require kapouet/laravel-notyf

包简介

Add Notyf support in your Laravel app

README 文档

README

Laravel Notyf banner

Latest Version on Packagist Total Downloads

Add Notyf support in your Laravel app.

Installation

You can install the package via composer

composer require kapouet/laravel-notyf

You can publish the config file with:

php artisan vendor:publish --provider="Kapouet\Notyf\NotyfServiceProvider" --tag="kapouet:config"

The config file is structured like Notyf, but in PHP, see https://github.com/caroso1222/notyf#api

Usage

Import assets

<!-- For CSS -->
<x-notyf::styles/>

<!-- For JS -->
<!-- Import this script after Livewire if you use it -->
<xnotyf::scripts/>

Send toast with PHP

Notyf::success('I\'m a success message');
Notyf::error('I\'m an error message');

// If you are added custom types in config file
// https://github.com/caroso1222/notyf#inotyfnotificationoptions
Notyf::message('custom', 'I\'m a custom message');

Send toast with Livewire

use Kapouet\Notyf\Traits\Livewire\WithNotyf;
use Livewire\Component;

class MyComponent extends Component
{
    use WithNotyf;
    
    public function render(): string
    {
        return <<<'blade'
            <div>
                <button wire:click="toast">Toast me</button>
            </div>
        blade;
    }
    
    public function toast(): void
    {
        $this->notyfSuccess('I\'m a success message');
        $this->notyfError('I\'m an error message');

        // If you are added custom types in config file
        // https://github.com/caroso1222/notyf#inotyfnotificationoptions
        $this->notyfMessage('custom', 'I\'m a custom message');
    }
}

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 1.02k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固