laravel-cors icon indicating copy to clipboard operation
laravel-cors copied to clipboard

Class Fruitcake\Cors\HandleCors does not exist

Open mecjos opened this issue 3 years ago • 4 comments

I get this error. My project is on godaddy shared server. I deleted barryvdh/laravel-cors, earlier cors package, then uploaded fruitcake one. Deleted old service providers and followed the installation guide but get this error.. Any solution for this?

mecjos avatar Nov 15 '20 19:11 mecjos

@mecjos shouldn't it be \Fruitcake\Cors\HandleCors::class ?

this works for me

$app->middleware([
    \Fruitcake\Cors\HandleCors::class,
]);

sharathm89 avatar Dec 22 '20 18:12 sharathm89

This issue come with laravel 7

Mohsin05 avatar Feb 20 '21 09:02 Mohsin05

I solve this issue first remove package and http -> kernel.php file
commented protected $middlewire=[ //\Fruitcake\Cors\HandleCors::class, ]

madfortech avatar Aug 07 '22 07:08 madfortech

In my case, I was able to resolve the issue by clearing my cache, config and optimizing the app.

My app runs on Laravel v8

Commands:

php artisan config:cache
php artisan cache:clear
php artisan optimize:clear

tripol avatar Sep 12 '22 00:09 tripol

Delete line 18 containing \Fruitcake\Cors\HandleCors::class,

Located in the following path: app/Http/kernel.php image

to become image

RashedAlmayyas avatar Oct 16 '22 10:10 RashedAlmayyas

good job so beautiful keep going

NOORshatnawi avatar Oct 16 '22 10:10 NOORshatnawi