Hello! :)
So, I am just re-watching a multiple hours long video on Laravel and I am still confused by "PUT" requests.
At first, the teacher showed how to create a new entry.
That, I understood.
Then, the teacher went on to show how to EDIT the priorly added entry.
In order to do so, he first created a new route, then added a controller, and then copied over the "create entry" blade template to the new "edit blade template".
When he was editing the edit Blade template, he said, that we have to make this a PUT request as it's UPDATING an entry rather than creating a new entry.
So, he used when he CREATED an entry, but he wants to use PUT when updating the entry.
That's what's got me really confused.
Why can't we use POST? Is this a Laravel specific thing?
Anyway, the teacher then proceeded to explain, that the tag would only accept GET or POST requests, so the teacher goes on to use the @method() directive in laravel like this:
<form method="post" action="/listings/{{$listing->id}}" enctype="multipart/form-data">
@csrf
@method('PUT')
Long story short:
Whyyyyy do we need PUT at all?
I have never used any PUT requests in my whole life!
Please tell me this is some Laravel specific thing, or have I just wrongfully never used PUT requests my whole life?
Thanks
Ronaldo