dreadkopp / laravel_slim_transceiver
Stack laravel on top of your existing slim application
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/dreadkopp/laravel_slim_transceiver
Requires
README
This small helper allows you to run laravel on top of your existing Slim app.
Install
composer require dreadkopp/laravel_slim_transceiver
Usage
(i assume you already installed Laravel on top of your existing slim project)
Laravel-side:
add to the Bottom of your routes/web.php:
Route::fallback([\dreadkopp\LaravelSlimTransceiver\SlimTransceiver::class,'handle'])
->withoutMiddleware( \App\Http\Middleware\VerifyCsrfToken::class);
Slim:
in /public you should have a slim.php, we need to slightly modify that.
First, rename it to sub_slim.php
Second we need a slight adjustment. Last line in your sub_slim.php should read something like
$app->run();
change that to
return $app->run(true);
Third you want to disable the start of session in your slim app code since the Transceiver will create a temporary one for you during runtime
Global
Last, point your webserver to public/index.php instead of public/slim.php