Skip to content

Instantly share code, notes, and snippets.

@lagbox
Last active October 16, 2019 20:22
Show Gist options
  • Save lagbox/fb65adb4331a61bc4a0714b62ecac678 to your computer and use it in GitHub Desktop.
Save lagbox/fb65adb4331a61bc4a0714b62ecac678 to your computer and use it in GitHub Desktop.
<form action="test?test=query" method="post">
@csrf
<input type="hidden" name="test" value="post" />
<input type="submit" value="blah" />
</form>
<?php
Route::view('test', 'test');
Route::post('test', function (Illuminate\Http\Request $request) {
dd([
'input' => $request->input('test'),
'get' => $request->get('test'),
'all' => $request->all(),
]);
});
/*
array:3 [▼
"input" => "post"
"get" => "query"
"all" => array:2 [▼
"_token" => ...
"test" => "post"
]
]
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment