I'm new to Laravel but learning fast. The documentation about Routing says the following:
Route::get($uri, $callback);
Route::post($uri, $callback);
Route::put($uri, $callback);
Route::patch($uri, $callback);
Route::delete($uri, $callback);
Route::options($uri, $callback);
I can code in PHP and know what POST and GET requests are. And also know how to update and delete records via SQL. But why are there so many Route types, aren't POST and GET enough?
And in which situations should I use the PUT
, PATCH
, DELETE
or OPTIONS
route?
Thanks in advance.
Theo