whossun/uikit-notify

为 Laravel 的 uikit 通知

dev-master 2017-02-01 06:18 UTC

This package is not auto-updated.

Last update: 2024-09-14 19:04:16 UTC


README

安装

为了安装 uikit-notify,只需将以下内容添加到您的 composer.json 中:

"whossun/uikit-notify": "dev-master"

然后运行 composer install 或 composer update。

将服务提供者添加到 config/app.php

Whossun\Notify\NotifyServiceProvider::class,

如果需要,可以可选地将 Facade 包含在 config/app.php 中。

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

选项

您可以为提醒设置自定义选项。运行以下命令以发布通知的配置文件:

php artisan vendor:publish

to publish the config file for notify.

基本

  • Notify::info('message', ['options']);

  • Notify::success('message', ['options']);

  • Notify::warning('message', ['options']);

  • Notify::danger('message', ['options']);

  • Notify()->info('message', ['options']);

<?php

Route::get('/', function () {
    Notify::success('Messages in here', ['pos' => 'top-center']);

    return view('welcome');
});

然后

您应该在您的 HTML 中添加 {!! Notify::render() !!}

MIT