PHPackages                             eptic/turbo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. eptic/turbo

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

eptic/turbo
===========

Helpers for making Hotwired Turbo work with Laravel

3.0.1(2y ago)1116[4 PRs](https://github.com/EPTIC-Solutions/turbo/pulls)MITPHPPHP ^8.1|^8.2

Since Dec 4Pushed 2y agoCompare

[ Source](https://github.com/EPTIC-Solutions/turbo)[ Packagist](https://packagist.org/packages/eptic/turbo)[ Docs](https://github.com/EPTIC-Solutions/turbo)[ GitHub Sponsors](https://github.com/EPTIC-Solutions)[ RSS](/packages/eptic-turbo/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (12)Versions (10)Used By (0)

Helpers for making Hotwired Turbo work with Laravel
===================================================

[](#helpers-for-making-hotwired-turbo-work-with-laravel)

[![](https://raw.githubusercontent.com/eptic-solutions/art/master/cover.png)](https://solutions.eptic.ro)

 [ ![Latest Version on Packagist](https://camo.githubusercontent.com/652f40b016d8a835eac2256d6cdfd49f5a562c9d1db3ff5563ac0f44f10b3216/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f65707469632f747572626f2e7376673f7374796c653d666c61742d737175617265) ](https://packagist.org/packages/eptic/turbo) [ ![GitHub Tests Action Status](https://camo.githubusercontent.com/f18db24d355610e536020aaa4ef1a01a3945314354526adde329471c93403ee3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f45505449432d536f6c7574696f6e732f747572626f2f72756e2d74657374733f6c6162656c3d7465737473) ](https://github.com/EPTIC-Solutions/turbo/actions?query=workflow%3Arun-tests+branch%3Amaster) [ ![GitHub Code Style Action Status](https://camo.githubusercontent.com/d81af6c9ee46649c7dfc2ba26040c0c03896272886b7fd82c114ee155a8acdcf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f45505449432d536f6c7574696f6e732f747572626f2f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65) ](https://github.com/EPTIC-Solutions/turbo/actions?query=workflow%3A) [ ![Total Downloads](https://camo.githubusercontent.com/05d87c312a523e9b28369947039cabca2f486229d6c699fdbdc3d85e4297ea5c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f65707469632f747572626f2e7376673f7374796c653d666c61742d737175617265) ](https://packagist.org/packages/eptic/turbo)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require eptic/turbo
```

As per the official @Hotwired/Turbo documentation, you will need to add the TurboMiddleware provided in this package to the `web` group inside `Kernel.php` to handle the redirects as Turbo expects them.
You can read more information about this in the official documentation:
[Redirecting After a Form Submission](https://turbo.hotwired.dev/handbook/drive#redirecting-after-a-form-submission)

Example:

```
'web' => [
    \App\Http\Middleware\EncryptCookies::class,
    \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
    \Illuminate\Session\Middleware\StartSession::class,
    // \Illuminate\Session\Middleware\AuthenticateSession::class,
    \Illuminate\View\Middleware\ShareErrorsFromSession::class,
    \App\Http\Middleware\VerifyCsrfToken::class,
    \Illuminate\Routing\Middleware\SubstituteBindings::class,
    -> \Eptic\Turbo\Middleware\TurboMiddleware::class,
],
```

You can publish the config file with:

```
php artisan vendor:publish --tag="turbo-config"
```

Optionally, you can publish the views used as templates using

```
php artisan vendor:publish --tag="turbo-views"
```

You can see the content of the config file in the configs folder.

Usage
-----

[](#usage)

### Turbo Frames

[](#turbo-frames)

To generate a turbo frame response

```
return response()->turboFrame()->generic(id: 'gallery', partial: view('pages.galleries._partials.create'), target: '#gallery-create');
```

Check if the request was made inside a turbo-frame:

```
request()->wantsTurboFrame()
```

### Turbo Streams

[](#turbo-streams)

To check if a request is a turbo stream request:

```
request()->expectsTurboStream()
```

To generate a turbo stream, you can use the `turboStream` method on the response object.
It has all the signatures present in the original documentation from Hotwired:

- Append: ```
    return response()->turboStream()->append(target: 'gallery-create', partial: view('pages.galleries._partials.create'));
    ```
- Prepend: ```
    return response()->turboStream()->prepend(target: 'gallery-create', partial: view('pages.galleries._partials.create'));
    ```
- Replace: ```
    return response()->turboStream()->replace(target: 'gallery-create', partial: view('pages.galleries._partials.create'));
    ```
- Update: ```
    return response()->turboStream()->update(target: 'gallery-create', partial: view('pages.galleries._partials.create'));
    ```
- Remove: ```
    return response()->turboStream()->remove(target: 'gallery-create');
    ```
- Before: ```
    return response()->turboStream()->before(target: 'gallery-create', partial: view('pages.galleries._partials.gallery'));
    ```
- After: ```
    return response()->turboStream()->after(target: 'gallery-create', partial: view('pages.galleries._partials.gallery'));
    ```

If you already have a view that contains the entire template and only want to set the correct content-type so it is recognised as a turbo stream, you can use:

```
return response()->turboStream()->view(view: 'pages.galleries.create', data: $data);
// Or you can pass in a view directly
return response()->turboStream()->view(view: view('pages.galleries.create', $data));
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Cristian Bilu](https://github.com/wizzymore)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 60.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~154 days

Total

5

Last Release

1006d ago

Major Versions

1.0.1 → 2.0.02022-03-17

2.0.1 → 3.0.12023-08-14

PHP version history (3 changes)v1PHP ^8.0

2.0.0PHP ^8.0|^8.1

3.0.1PHP ^8.1|^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/007d894ba9912b39d7bd460673f516a0a573fad90c0277a6711167cf323df5c8?d=identicon)[wizzymore](/maintainers/wizzymore)

---

Top Contributors

[![wizzymore](https://avatars.githubusercontent.com/u/25827787?v=4)](https://github.com/wizzymore "wizzymore (35 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (12 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (11 commits)")

---

Tags

hotwiredlaravelturbolaravelturboeptic

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/eptic-turbo/health.svg)

```
[![Health](https://phpackages.com/badges/eptic-turbo/health.svg)](https://phpackages.com/packages/eptic-turbo)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
