Different session drivers depending on the route in Laravel

I start with Laravel and wonder if it is possible and relatively elegant to use a different session driver depending on the requested route.

Ideally, I would like to share the functionality of my models between my main application and the accompanying REST API and use my own session driver for the main application (/ admin) and an array driver for the REST API (/ admin / api). Using different configuration files for different environments is obvious to me, but it will be the same environment, only different routes.

If someone could point out the best way to do this in Laravel, he would be very grateful.

+4
source share
1 answer

The Laravel forum had helpful tips on a workaround for this:

http://forums.laravel.io/viewtopic.php?id=5684

0
source

Source: https://habr.com/ru/post/1502704/


All Articles