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
you have to run php artisan install:api
Since Laravel 11 the api functionality doesn’t come by default, you need to run the command
php artisan install:api
to create theroutes/api.php
file and install Laravel Sanctum.You can learn more here: https://laravel.com/docs/11.x/routing#api-routes