I define a route in my routes/api.php
Route::post('Client/LoginClient',[ClientController::class,
function(Request $request) {
}]);
and when I post something to the route, I encounter this error:
419 Page Expired
How could I post data to the route?
Edit #1:
I am posting data via Postman.
2
Answers
In
VerifyCsrfToken
class, I added "*" to the except array, and the problem is solved.But, I do not know what CSRF verification is?
If you don’t want to use CSRF protection for this particular route, you can exclude it from CSRF protection by adding the route to the
$except
property in the VerifyCsrfToken middleware.Open the AppHttpMiddlewareVerifyCsrfToken class and add your route to the $except array.