PHP code example of eptic / turbo
1. Go to this page and download the library: Download eptic/turbo library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
eptic / turbo example snippets
'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,
],
return response()->turboFrame()->generic(id: 'gallery', partial: view('pages.galleries._partials.create'), target: '#gallery-create');
request()->wantsTurboFrame()
request()->expectsTurboStream()
return response()->turboStream()->append(target: 'gallery-create', partial: view('pages.galleries._partials.create'));
return response()->turboStream()->prepend(target: 'gallery-create', partial: view('pages.galleries._partials.create'));
return response()->turboStream()->replace(target: 'gallery-create', partial: view('pages.galleries._partials.create'));
return response()->turboStream()->update(target: 'gallery-create', partial: view('pages.galleries._partials.create'));
return response()->turboStream()->remove(target: 'gallery-create');
return response()->turboStream()->before(target: 'gallery-create', partial: view('pages.galleries._partials.gallery'));
return response()->turboStream()->after(target: 'gallery-create', partial: view('pages.galleries._partials.gallery'));
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));
bash
php artisan vendor:publish --tag="turbo-config"
bash
php artisan vendor:publish --tag="turbo-views"