-
Notifications
You must be signed in to change notification settings - Fork 576
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
Controller getForm runs before middleware #2710
Comments
Workaround-solution for googlersCopy file Then modify the file in the vendor-override folder in the following way. modify composer.json:
ModuleController.php changes for reference: OLD METHOD
NEW METHOD
|
Description
The ModuleController method getForm() runs before any middleware is run.
Why is that a problem?
It makes it impossible to modify the form based on user.
Both of these do not work, because Auth::user() is not available (yet).
Steps to reproduce
add
dd(Auth::id())
to the getForm methodExpected result
I get a dd with the value 1 (id of the current user)
Actual result
I get a dd with the value null
Versions
Twill version: 3.3.1
Laravel version: 11.0
PHP version: 8.2
Database engine: MySQL (Xampp)
Note
I would also be content with some kind of hack to achieve this behavior, but I couldn't figure out which vendor files to overwrite for that.
The text was updated successfully, but these errors were encountered: