laravel-localization icon indicating copy to clipboard operation
laravel-localization copied to clipboard

Feat: WIP Laravel Octane support

Open jangaraev opened this issue 2 years ago • 11 comments

  1. binding in service provider changed to a way proposed by Laravel Octane in case if we detect it
  2. introduced a listener to hook into Octane's RequestReceived event

Refs: #780

jangaraev avatar Jun 21 '22 14:06 jangaraev

Let's start with that. I will test this on the staging platform of my live project.

My main point to consider is can we completely switch to bind() in the service provider instead of permanently checking for Octane's presence. I'm worrying it affects performance badly for non-Octane environments.

Also did nothing with unit tests.

jangaraev avatar Jun 21 '22 14:06 jangaraev

Just a small update.

Tested this code

  • on the live project with Octane enabled and everything works super-fine
  • locally on the regular environment with no Octane --> fine as well

jangaraev avatar Jun 23 '22 08:06 jangaraev

Any news @jangaraev to undraft this? :)

sylouuu avatar Jul 22 '22 08:07 sylouuu

hi. sorry for the silence. I was on vacation last 2 weeks.

The code in PR is good actually, tested this in projects I work on. My idea was to provide proper tests for that, but I have a quite limited experience on testing Octane. so I'm stuck at the moment.

I need to check how to test things in Laravel in default and octane enabled environments.

jangaraev avatar Aug 01 '22 07:08 jangaraev

Any news about merging PR and updating the localization package?

Thanks

didix16 avatar Sep 07 '22 10:09 didix16

Hello! Any news from here? Because there are problems with Laravel Ocatane now. When you use 'localeCookieRedirect', 'localizationRedirect' middlewares, you have got infinitive redirect cycle

fomenko-oi avatar Jan 18 '23 21:01 fomenko-oi

@jangaraev Any news about the PR? :wink:

taai avatar Aug 13 '23 14:08 taai

Any updates on this pull request? I would really love Octane support. :)

korridor avatar Aug 21 '23 09:08 korridor

any update please???? @mcamara

UtkuDalmaz avatar Sep 05 '23 10:09 UtkuDalmaz

I tried the solution and it didn't solve the problem for me. I also looked into the code of the solution, and it seems a bit hacky, but I'm not that deep into this plugin.

Since this broke my production environment and I needed a multi-language solution fast, I uninstalled this plugin and used this instead: https://github.com/codezero-be/laravel-localized-routes

Worked with Octane out of the box and the migration process was surprisingly easy. I think it is also nice that route:cache works normally there.

korridor avatar Sep 05 '23 14:09 korridor

I tried the solution and it didn't solve the problem for me. I also looked into the code of the solution, and it seems a bit hacky, but I'm not that deep into this plugin.

Since this broke my production environment and I needed a multi-language solution fast, I uninstalled this plugin and used this instead: https://github.com/codezero-be/laravel-localized-routes

Worked with Octane out of the box and the migration process was surprisingly easy. I think it is also nice that route:cache works normally there.

perfect thanks

UtkuDalmaz avatar Sep 06 '23 14:09 UtkuDalmaz