4
votes

I'm starting out with Laravel and was wondering if it's possible and relatively elegant to use a different session driver depending on the route requested.

Ideally I'd like to share the functionality of my models between my main app and its accompanying REST API, and use the native session driver for the main app (/admin), and the array driver for the REST API (/admin/api). Using different config files for different environments is obvious to me, but this would be the same environment just different routes.

If someone could point out the best method to do this in Laravel it'd be most appreciatied.

1
Taylor was talking with RyanTablada about this: twitter.com/RyanTablada/statuses/379640196209184768Antonio Carlos Ribeiro
Thanks Antonio- looks like there's still no supported method for this in Laravel, fingers crossed for implementation in a future versionRyan Marshall
I just posted my solution on a similar question. stackoverflow.com/a/28042265/2161941Richard A Quadling

1 Answers

0
votes

The Laravel forum had some helpful suggestions on a workaround for this:

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