Route Setup
The first route Route::get('/updateform/{id}', [CrudController::class, 'updateview'])->name('updateview.data'); handles a GET request. When a user visits this URL (/updateform/{id}), this route calls the updateview function of CrudController. {id} is a placeholder that identifies a specific resource (such as a user or item). This function is usually used to display a form in which the user gets the option to update the data.
Second route Route::post('/updatesubmit/{id}', [CrudController::class, 'updatedate'])->name('updatesubmit.data'); Handles a POST request. This route is triggered when a user submits a form. In this also the specific resource is updated using the {id}. This route calls the update function of the CrudeController, in which the data submitted by the form is processed and updated. This route sends the form data to the server, due to which the database gets updated.