From Laravel 11, Laravel doesn't include an api.php by default. So we need to install it. Simply, we can create it using the below command.
php artisan install:api
This command will set everything.