Turbo Laravel

Build web and hybrid native apps in Laravel today.

Turbo Laravel integrates your Laravel application with Hotwire, an alternative way of building web and native apps with minimal JavaScript, sending HTML over the wire.

Your typical Laravel app.

Hotwire was built for full-stack web frameworks, like Laravel and Rails. Modern web applications don't have to be built as stateful components. We can keep writing regular Cruddy applications, with controllers, Blade views and so on, and progressively enhance the fidelity of our UIs using Turbo Frames, Turbo Streams, or JavaScript.

<!-- File: chirps/show.blade.php -->
<x-turbo::frame :id="$chirp">
    <p>{{ $chirp->content }}</p>
    <a href="{{ route('chirps.edit', $edit) }}">
        Edit
    </a>
</x-turbo::frame>

<!-- File: chirps/edit.blade.php -->
<x-turbo::frame :id="$chirp">
    <form action="{{ route('chirps.update', $chirp) }}" method="POST">...</form>
</x-turbo::frame>

Decompose screens with Turbo Frames.

Turbo Frames allow predefined sections of your page to be updated on request, independently of the rest of the page. We can build things like data tables, inline forms, and so on with a blink of an eye.

class Comment extends Model
{
    use Broadcasts;
}

// And then...

$comment = $post->comments()->create();

$comment->broadcastPrependTo($post)
    ->toOthers()
    ->later();

Come Alive with Turbo Streams.

Turbo Streams deliver page changes as fragments of HTML. They may be delivered to the browser synchronously after form submits, or asynchronously over WebSockets via Laravel Echo.

class ChirpsController
{
    use InteractsWithHotwireNativeNavigation;

    public function store(ChirpRequest $request)
    {
        $request->user()->chirps()->create(
            $request->validated()
        );

        return $this->recedeOrRedirectTo(
            to_back(route('chirps.index'))
        )->with('notice', __('Chirp created.'));
    }
}

Go Native with iOS & Android.

Hotwire Native lets your Laravel application be the center of your native iOS and Android apps, with seamless transitions between web and native screens. Turbo Laravel has tons of helpers for instrumenting your Hotwire Native clients!

it('creates chirps', function () {
    $response = $this->post(route('chirps.store'), [
        'content' => 'Test Chirp',
    ]);

    $response->assertTurboStream(fn (AssertableTurboStream $streams) => (
        $streams->has(1)
        && $streams->hasTurboStream(fn ($turboStream) => (
            $turboStream
                ->where('target', 'chirps')
                ->where('action', 'prepend')
                ->see('Test Chirp')
        ))
    ));
});

Everything is testable.

Turbo Laravel ships with a series of testing helpers out of the box, so you can ensure your application is fully tested. The best part is that not much changes from your typical Laravel testing approach.


The Bootcamp

In order to help you to get a better understanding of the many sides of Hotwire, we offer a free Bootcamp inspired by the official Laravel Bootcamp. In the Turbo Laravel Bootcamp, you’ll get a hands-on introduction to Hotwire and Turbo Laravel building a web application from scratch and then building the hybrid native app for it.