So my code looks like this:
<form method="get" action="{{URL::to('users', $_GET['username'])}}">
<input type="text" name="username">
<input class="but-submit" type="submit" name="submit">
</form>
I want my link to look like users/anydata, so that I could use it to fetch info from database.
My controller look like this:
Route::resource('users', 'UsersController');
I hope this can help you.
--Write a JavaScript function and update the URL
<form name="mForm" method="get" onSubmit="formSubmitAction(this)">
function formSubmitAction()
{
var username = document.getElementsByName("username").value;
document.mForm.action = "http://yourURL.com/"+username;
document.myForm.submit();
}