Looking to hire Laravel developers? Try LaraJobs

laravel-hotwire-turbo maintained by emaia

Description
Hotwire Turbo with Laravel
Author
Last update
2026/04/13 23:25 (dev-main)
License
Downloads
676

Comments
comments powered by Disqus

Hotwire Turbo with Laravel!

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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-hotwire-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.