承接 hafizulislamhfz/dy-toast 相关项目开发

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

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

hafizulislamhfz/dy-toast

最新稳定版本:v1.0.4

Composer 安装命令:

composer require hafizulislamhfz/dy-toast

包简介

A dynamic toast notification package for Laravel

README 文档

README

A dynamic toast notification package for Laravel.

Installation

Install the package using Composer:

composer require hafizulislamhfz/dy-toast

After installed, publish the toast resources:

php artisan dytoast:publish

Modify Your app.blade.php (or Main Layout) In the main layout file (resources/views/layouts/app.blade.php). To ensure the toast system works correctly, you need to include the dy-toast component before any scripts or dynamic content that may trigger a toast.

<!DOCTYPE html>
<html lang="en">
<head>
    {{-- head --}}
</head>
<body>
    {{-- Load DyToast early to ensure it initializes before usage --}}
    @include('components.dy-toast.toast')
    {{-- or --}}
    <x-dy-toast.toast />
</body>
</html>

Usage

Trigger Toast Notifications

Use the toast in controllers or anywhere within Laravel:

use Hafizulislamhfz\DyToast\Facades\Toast;

// Display a success message
Toast::success('Operation completed successfully!');
toast('Operation completed successfully!');

// Display an error message
Toast::error('Something went wrong!');
toast('Something went wrong!', 'error');

// Display a warning message
Toast::warning('This is a warning!');
toast('This is a warning!', 'warning');

// Display an info message
Toast::info('Some useful information here!');
toast('Some useful information here!', 'info');

Use the toast in script:

<script>
    // Display a success message
    toast('Operation completed successfully!');
    toast.success('Operation completed successfully!');

    // Display an error message
    toast('Something went wrong!', 'error');
    toast.error('Something went wrong!');

    // Display a warning message
    toast('This is a warning!', 'warning');
    toast.warning('This is a warning!');

    // Display an info message
    toast('Some useful information here!', 'info');
    toast.info('Some useful information here!');
</script>

Preview

DyToast Preview

License

DyToast is open-source software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固