call laravel post route code example
Example 1: call laravel route js
function confirmDelete(id){
let url = "{{ route('getDeleteRequest', ':id') }}";
url = url.replace(':id', id);
document.location.href=url;
}
Example 2: laravel routing controller get and post method
Route::match(['GET', 'POST'], '/page-name', [App\Http\Controllers\NameController::class, 'index']);