Skip to content
Discussion options

You must be logged in to vote

If anyone needs;

I use sluggable and translatable together. I serve API service but my needs require also translation for 3 languages. In order to do that, i add those two middlewares to main middleware array not under any middleware group in app.Http.Kernel.php file.

\Illuminate\Session\Middleware\StartSession::class,
\App\Http\Middleware\Localization::class,

StartSession middleware makes you able to hold session, its added under web middleware group by default. But in my case, you should add this to main middleware array to hold session in API service.

Localization middleware is my own middleware for language system.

When add StartSession middleware under api middleware group, it didn'…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gorkem358
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant