Unable to POST a form with laravel

i am unable to post a form and print it on. As u can see form my route:list i have worked on another controller called OrderController and everything on that was fine. but after finishing the OrderController i moved to the account Controlling step and got stuck where i cannot POST a form and see the values i entered on it. also if i use the named route it shows [email protected] as a URL. also on the route list the Action is different from every other route action also the uri. Can someone explain me? what have i done wrong? i just couldn’t figure it out tried a lot.

Route List

Route: Route::post('/accounts'. '[email protected]');

Controller:

public function store() {
dd(request()->input);
return ('test');
}

Form:

<form action="/accounts" method="POST">
@csrf
<div class="form-row">
<div class="col-md-2 mb-3">
<label for="name">Name</label>
<input type="text" class="form-control" id="name" placeholder="someone" name="name" required>
<div class="valid-feedback">
Looks good!
</div>
</div>
<div class="col-md-2 mb-3">
<label for="email">Email</label>
<input type="text" class="form-control" id="email" placeholder="[email protected]" name="email" required>
<div class="valid-feedback">
Looks good!
</div>
</div>
<div class="col-md-2 mb-3">
<div class="form-group">
<label for="password">Password</label>
<input type="password" class="form-control" id="password" name="password" required placeholder="***********">
</div>
</div>
<div class="col-md-2 mb-3">
<label for="district">District</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="inputGroupPrepend">@</span>
</div>
<input type="text" class="form-control" id="district" aria-describedby="inputGroupPrepend" name="district" required placeholder="">
<div class="invalid-feedback">
Please choose a username.
</div>
</div>
</div>
<div class="col-md-1 mb-3">
<div class="form-group">
<label for="role">Role</label>
<select class="form-control" id="role" name="role">
<option>Select a role</option>
<option value="admin">Admin</option>
<option value="staff">Staff</option>
</select>
</div>
</div>
<div class="col-md-1 mb-3">
<label for="validationCustomUsername"> </label>
<div class="form-group">
<button type="submit" class="btn btn-primary">Add</button>
</div>
</div>
</div>
</form>

Error: SymfonyComponentHttpKernelExceptionMethodNotAllowedHttpException The POST method is not supported for this route. Supported methods: GET, HEAD. http://127.0.0.1:8000/accounts

from Newest questions tagged laravel-5 – Stack Overflow https://ift.tt/2S0a4uz
via IFTTT

Related Posts

Codeigniter : Parse error: syntax error, unexpected ‘const’ (T_CONST), expecting variable (T_VARIABLE) in Laravel project

I’m getting following error: **Parse error: syntax error, unexpected ‘const’ (T_CONST), expecting variable (T_VARIABLE)** Note : It’s working in local but facing issue in production server. private…

Firebase receive notification while tab is active or on focus

What i want is to be able to perform an action when a user receives a notification while the browser is open and tab is active or…

Laravel’s alias loader does not find class

We have a legacy project that we cannot update and we need to make some changes in symfony’s Response.php in vendor. We have solved this by copying…

Laravel 5 – generic document management

I have a system where you can create different types of unique documents. For instance, one document is called Project Identified and this expects certain inputs. Originally,…

Laravel Nova limit the results in indexQuery

I ran intro a situation where I need to limit the results of a resource to only 3 results. To be more specific, based on the logged…

Auditoria en laravel 5.8 [closed]

Cómo puedo automatizar el registro de actividades de un usuario en laravel? Si un usuario ingresa a un app de laravel, debo guardar toda su actividas, a…

Leave a Reply

Your email address will not be published.