承接 awalhadi/laravel-toastr 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

awalhadi/laravel-toastr

最新稳定版本:v1.0.2

Composer 安装命令:

composer require awalhadi/laravel-toastr

包简介

Easy Toastr notifications for Laravel

README 文档

README

Easy Toastr notifications for Laravel 8+

Installation

You can install the package via composer:

composer require awalhadi/laravel-toastr

Usage

You can use the toastr() helper function or the ttoastr() function for typed notifications:

// In your controller
public function store()
{
    // Your logic here

    toastr()->success('Post created successfully!');
    // or
    toastr('Post created successfully!', 'success');
    // or
    ttoastr('success', 'Post created successfully!');

    return redirect()->route('posts.index');
}

You can also chain methods for more control:

toastr()->position('top-left')->success('Message');

Available types: success, info, warning, error

In your blade template, include the Toastr view:

@include('toastr::toastr')

The required CSS and JS files will be automatically included when a notification is fired.

Configuration

To publish the config file:

php artisan vendor:publish --provider="YourVendor\LaravelToastr\ToastrServiceProvider" --tag="config"

You can customize the default options in the published config file.

Testing

composer test

License

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

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-16