Laravel API route Page Expires

  laravel, php

I have a quick question I know it wouldn’t take so much time to fix but somehow I don’t seem to easily find the solution.

I am building a basic api for a mobile application. I placed by api routes in api.php

<?php

use IlluminateHttpRequest;
use IlluminateSupportFacadesRoute;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/



Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

Route::post('/v1/meeting/record', '[email protected]');


The problem is anytime I send a request to this route it responds with page status 419 (Page Expired).

This is my record method in the Attendance Controller

public function record(Request $request)
    {
        return response()->json([
            "message" => "student record created"
        ], 201);


    }

I added the api/* to the excludes in verifycsrftoken.php but it didn’t change anything.

Am I doing anything wrong?

Source: Laravel

Leave a Reply