承接 simtabi/larabell 相关项目开发

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

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

simtabi/larabell

Composer 安装命令:

composer require simtabi/larabell

包简介

Sweetalert and Toaster notifications for Laravel livewire with support for tailwind and bootstrap

README 文档

README

banner

Larabell

A Laravel Livewire library to help you integrate SweetAlert and Toasts on yor applications.

Installation

composer require simtabi/larabell

How to use

1. Add LarabellServiceProvider in config/app.php

    ...
    \Simtabi\Larabell\LarabellServiceProvider::class
    ...

2. Include javascript

    ...
    // place this directive in the header
    @larabellCss

    // no need to call this, as it has already been called when you call @larabellScripts
    @larabellInit
    ...

3. Extra config file

Publish the configs: php artisan vendor:publish --tag=larabell:assets. Publish the configs: php artisan vendor:publish --tag=larabell:config. Publish the configs: php artisan vendor:publish --tag=larabell:views.

See available configuration

Building toasts and sweetalerts

To make it easy to build toasts and sweetalerts, we have implemented chained methods to help you with building

Sweetalert

In your component add Toast trait. Then call toast method whenever you want.

use Simtabi\Larabell\HasLarabell;
use Livewire\Component;

class MyComponent extends Component
{
    use HasLarabell;

    public function save() {
        $this->fireSwalNotification();
    }

}

sweetalert parameters:

  • title
  • icon: success, error, warning, info, question - default is info
  • timeout: in milliseconds, default is 5000

Toast

This is the normal sweetalert modal. In your component add Fire trait. Then call fire method whenever you want.

use Simtabi\Larabell\HasLarabell;
use Livewire\Component;

class MyComponent extends Component
{
    use HasLarabell;

    public function save() {
        $this->fireToastNotification();
    }

}

toast parameters:

Refer to the documentation online at: https://github.com/kamranahmedse/jquery-toast-plugin

Credits

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-13