johnnyfreeman/laravel-turbo
Hotwire Turbo integration for Laravel.
3,837
1
| Install | |
|---|---|
composer require johnnyfreeman/laravel-turbo |
|
| Latest Version: | 0.2 |
| License: | MIT |
| Last Updated: | Mar 11, 2023 |
| Links: | GitHub · Packagist |
Maintainer: johnnyfreeman
Hotwire Turbo for Laravel
Some lightweight tools for sending Turbo Streams to the front end.
Installation
You can install the package via composer:
composer require johnnyfreeman/laravel-turbo
Usage
Controler
class PostCommentController
{
public function store(Request $request, Post $post)
{
$comment = $post->comments()->create([
'text' => $request->get('text')
]);
if ($request->wantsTurboStream()) {
return turbo_stream()
->prepend('comments', view('posts.comment', ['text' => $comment->text]))
->append('notifications', view('notifications.simple', ['title' => 'Post comment created!']));
}
return back();
}
}
License
The MIT License (MIT). Please see License File for more information.
Related Packages
hotwired-laravel/turbo-laravel
Turbo Laravel gives you a set of conventions to make the most out of the Hotwire...
537,519
838
hadyfayed/siren
Laravel KickStart
9
0
filament
filament-shield
filament-spatie-laravel-backup
filament-spatie-laravel-health
hadyfayed
hotwire
jetstream
laravel
laravel-settings
laravel-sluggable
livewire
siren
spatie
spatie-laravel-media-library-plugin
spatie-laravel-settings-plugin
spatie-laravel-tags-plugin
spatie-laravel-translatable-plugin
turbo-laravel
shahabzebare/laravel-nova-turbo
Turbocharge Laravel Nova by lazy loading resources. Dramatically improves perfor...
1,453
2