dreadkopp/laravel_slim_transceiver

There is no license information available for the latest version (0.1.9) of this package.

Stack laravel on top of your existing slim application

0.1.9 2021-01-16 01:46 UTC

This package is auto-updated.

Last update: 2024-05-10 18:44:48 UTC


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