-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[9.x] Adds ability to compiles new http verbs directives 🚦 #45927
Conversation
this seems excessive, IMO. we're not gaining anything with the switch, save a few keystrokes. if this were to get merged, would it have to go to 10.x, in case someone is defining these in userland? I'm not sure the precedence when it comes to Blade. |
@browner12 userland directives will take precedence over framework ones. See #28062 (comment) I like the idea, but wanted to also replace the need for I've managed to do this with the following API: <!-- BEFORE -->
<form method="post" action="/users/{{ $user->id }}">
@csrf
@method('PATCH')
</form>
<!-- AFTER -->
<form @patch("/users/{$user->id}")">
@csrf
</form> This adds the It is still possible to put it into the method body via @mahmoudmohamedramadan's original API. No arguments: outputs the hidden input. FYI: a url can have more than one question mark, but the first one always indicates the start of the query parameters, hence the primitive string concatenation is possible without fully parsing into a URL structure. |
@timacdonald The feature of canceling |
I have updated the code according to the new code style that @timacdonald suggested but, I found some issues, so I have solved these issues and the code style has changed again 🚀. Before<form method="post" action="/users/{{ $user->id }}">
@csrf
@method('PATCH')
</form> AFTER<form @patch("/users/{$user->id}")>
@csrf
@patch
</form> |
@mahmoudmohamedramadan are you sure it can't be in the query string. Here is the source: |
Here is a quick script to demo the query parameter working.
|
@taylorotwell Whenever I submit the form, the 419 exception is thrown. |
Is the form using use the |
Tabling this one for now. |
@taylorotwell This pull request will never be merged? |
This PR allows us to use the new short directives instead
@method
directive, let's examine the next code for more illumination.BEFORE
But after this PR gets merged, the code will be like so 🎉
AFTER