定制 php-flasher/flasher-sweetalert 二次开发

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

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

php-flasher/flasher-sweetalert

Composer 安装命令:

composer require php-flasher/flasher-sweetalert

包简介

PHPFlasher - A powerful & easy-to-use package for adding flash messages to Laravel or Symfony projects. Provides feedback to users, improves engagement & enhances user experience. Intuitive design for beginners & experienced developers. A reliable, flexible solution.

README 文档

README

Latest Version Total Downloads License

SweetAlert2 adapter for PHPFlasher. Beautiful alert dialogs with modal and toast support.

Requirements

  • PHP >= 8.2
  • PHPFlasher ^2.5.1

Installation

composer require php-flasher/flasher-sweetalert

Quick Start

// Basic usage
sweetalert('Operation completed successfully!', 'success');
sweetalert('An error occurred.', 'error');
sweetalert('Information message.', 'info');
sweetalert('Warning message.', 'warning');

// With options
sweetalert('Success message', 'success', [
    'timer' => 3000,
    'toast' => true,
    'position' => 'top-end',
]);

// Modal dialog with options
sweetalert('Profile updated!', 'success', [
    'confirmButtonText' => 'Great!',
    'timer' => 5000,
]);

Features

  • Simple API: success(), error(), info(), warning(), flash()
  • SweetAlert2 Options: timer, toast, position, showConfirmButton, showCancelButton
  • Modal Support: Full SweetAlert2 modal dialogs and toasts
  • Type Safety: Full PHP type hints and PHPStan support
  • Helper Functions: Global sweetalert() helper for quick access

Available Methods

// Success notification
sweetalert($message, 'success', $options, $title);

// Error notification
sweetalert($message, 'error', $options, $title);

// Info notification
sweetalert($message, 'info', $options, $title);

// Warning notification
sweetalert($message, 'warning', $options, $title);

// Custom notification type
sweetalert($message, $type, $options, $title);

// With options
sweetalert($message, 'success', [
    'timer' => 3000,
    'toast' => true,
    'position' => 'top-end',
], $title);

Documentation

Complete documentation: php-flasher.io

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-05-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固