Support the ongoing development of Laravel.io →
Database Blade Forms
Last updated 2 years ago.
0

I haven't used the HTML Helpers since 4.2 so I don't know if they are doing it automatically for you. But for PUT, PATCH, and DELETE methods you need to have a hidden input field. This field needs to be called _method.

You can read about it here: https://laravel.com/docs/5.3/routing#form-method-spoofing

~ https://laracademy.co/

0

They do automatically put it in. I checked the html, printed here for you:


<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Missionseek</title>
	   <!-- Fonts -->
        <link href="https://fonts.googleapis.com/css?family=Raleway:100,600" rel="stylesheet" type="text/css">
		<link rel="stylesheet" href="/css/app.css">

		</head>
<body>

	<div class="flex-center position-ref full-height">
                            <div class="top-right links">
					<a href="http://localhost:8000/Agency">Agencies</a>
					<a href="http://localhost:8000/User">Users</a>
                    <a href="http://localhost:8000/login">Login</a>
                    <a href="http://localhost:8000/register">Register</a>
                </div>
            	<div class="container">
		    <h1>This is a test.</h1>
    <ul>
            </ul>
    <form method="POST" action="http://localhost:8000/users" accept-charset="UTF-8" class="form"><input name="_method" type="hidden" value="PUT"><input name="_token" type="hidden" value="xmTLggTGICaRCzTrp9oJPfebzhN20cdCXj5p00kY">

    <div class="form-group">
         <input type="hidden" name="_token" value="xmTLggTGICaRCzTrp9oJPfebzhN20cdCXj5p00kY">
        <label for="Your Name">Your Name</label>
        <input required="required" class="form-control" placeholder="Your name" name="name" type="text" value="Jonnyboy">
    </div>

    <div class="form-group">
        <label for="Your E-mail Address">Your E-mail Address</label>
        <input required="required" class="form-control" placeholder="Your E-mail Address" name="email" type="text" value="[email protected]">
    </div>
    <div class="form-group">
        <input class="btn btn-primary" type="submit" value="Submit">
    </div>
    </form>

	</div>
	
		
</body>
</html>
Last updated 8 years ago.
0

Problem solved. $user->id needed to be $user->ID. This is sometimes allowed by laravel, but in this case the capitalisation was strict.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Mugluck mugluck Joined 19 Oct 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.