skip to Main Content

since the LARAVEL omits the API.PHP, when I define the routes, Route:: API Resource(‘students’, Student Controller::class); and I access http://localhost:8000/api/students I get "The route API/students could not be found.",

i have tried a lot like: PHP artisan route :clear(cache and list), but it does not work

2

Answers


  1. Chosen as BEST ANSWER

    you have to run php artisan install:api


  2. Since Laravel 11 the api functionality doesn’t come by default, you need to run the command php artisan install:api to create the routes/api.php file and install Laravel Sanctum.

    You can learn more here: https://laravel.com/docs/11.x/routing#api-routes

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search