emaia/laravel-hotwire-turbo
最新稳定版本:v0.1.6
Composer 安装命令:
composer require emaia/laravel-hotwire-turbo
包简介
Hotwire Turbo with Laravel
README 文档
README
The purpose of this package is to facilitate the use of Turbo (Hotwire) in a Laravel app.
Installation
You can install the package via composer:
composer require emaia/laravel-turbo
Usage
/* Some controller method... */ public function update(Request $request) { /* ... */ if (request()->wasFromTurboFrame('modal')) { $streamCollection = new StreamCollection([ new Stream( Action::PREPEND, 'flash-container', view('components.flash-message', [ 'hasSuccess' => true, 'message' => $successMessage, ]) ), new Stream( Action::UPDATE, 'modal', '' ), ]); return response()->turboStream( $streamCollection ); } return redirect()->back()->with('success', $successMessage); }
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 20
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-07