Unable to locate the api.php route file in Laravel 11

367 Views Asked by At

I am attempting to integrate Laravel 11 with React.js for data retrieval and transmission between the two. However, I cannot locate the routes/api.php file in the latest version of Laravel.

I have searched for others experiencing the same issue, but I have yet to find any similar cases since Laravel 11 was only released a week ago.

2

There are 2 best solutions below

0
ericmp On BEST ANSWER

https://laravel.com/docs/11.x/routing#api-routes

If your application will also offer a stateless API, you may enable API routing using the install:api Artisan command:

php artisan install:api

[...] In addition, the install:api command creates the routes/api.php file.

1
Sandalanka On

You enable api route

php artisan install:api

you can refer to this link:enter link description here