I'm creating a project with Laravel that will have to connect to my frontend created with react. I hosted the backend on 000webhost but it gives me CORS error when I try to make an api call. I read that for Laravel 10 you no longer use fruitcake/laravel-cors but just have
\Illuminate\Http\Middleware\HandleCors::class
the app/Http/Kernel.php file. I've already done this but it keeps giving me the same errors. How do I solve it?
Do I need to specify the Middleware in the routes or does it apply automatically?
The error Cross-origin request blocked: Origin match policy does not allow reading remote resource from https://expense-api.000webhostapp.com/api/login. Reason: CORS request failed. Status code: (null).