Im using vue axios call to access Laravel API's from localhost
Scenario 1: In axios call i got error
The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed
then in Laravel API i put
header("Access-Control-Allow-Origin", "*");
this error goes and that axios call works
Scenario 2: For another axios call i got error
No 'Access-Control-Allow-Origin' header is present on the requested resource
then in Laravel API i put
header('Access-Control-Allow-Origin: *');
this error goes and that axios call works
In Laravel Kernel.php i have
protected $middleware = [
\Fruitcake\Cors\HandleCors::class,
];
Please check header slight differnces... why i need different header's for different calls? How can i resolve this?