Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not really working in Laravel #66

Open
AngelinCalu opened this issue Jan 27, 2024 · 3 comments
Open

Not really working in Laravel #66

AngelinCalu opened this issue Jan 27, 2024 · 3 comments

Comments

@AngelinCalu
Copy link

Has someone actually tried using this in a Laravel project?

It only seems to only work when writing a closure function in the route definition. When trying to use a controller method it doesn't properly forward the POST request parameters.

@joanhey
Copy link
Owner

joanhey commented Jan 28, 2024

Also work with controller method in the routes.

But you need to remember that now the app is persistent. It boots your application once and keeps it in memory while serving requests. Like with Octane, Swoole, ...
Any code will be very careful with singletons, static properties, bad static methods, globals, ... when using persistent applications.

The advise is the same than for Octane or Laravel-s (swoole).

Also a lot of libs are not ready to be used in persistent apps, but with Octane more libs are adapting their code to work.

With Symfony and other frameworks, almost all apps work or need minimal changes. With Laravel, fail more apps, but they are adapting the code to persistent apps (octane, swoole,...). Octane actually clean a lot of static properties and services in the terminate step. We can do the same, but now we don't have enough free time. And still we can't fix any app using bad techniques for persistent apps.

@RayWP
Copy link

RayWP commented Mar 2, 2024

I think same thing happened to me, according to the tutorial i need to put this to start.php (I follow the server.php and start.php tutorial)
image
but when i return the Request object in the controller, it is null, as if the request body isn't there to the controller
did i do something wrong?

PHP Version: 8.2.4
OS: Windows
Laravel version: 9.52.16

@joanhey
Copy link
Owner

joanhey commented Mar 3, 2024

That work correctly.
But I don't see the code before the function run().

Please check again the Laravel recipe:
https://github.com/joanhey/AdapterMan/blob/master/recipes/laravel.md#change-the-code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants