Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ekn's avatar
Level 1

Problems with 'php artisan test' after upgrade 6.x -> 7.x

After upgrading from 6.x to 7.x following the official upgrade doc I could make everything work except the php artisan test command.

$ php artisan test

In Application.php line 690:
Class 'Barryvdh\Cors\ServiceProvider' not found

Does anybody have a clue how to fix this? I searched for 'Barryvdh\Cors\ServiceProvider' everywhere in my code, added ' Fruitcake\Cors\CorsServiceProvider::class' to App config, etc. Also composer update did not help.

Maybe I need to republish something related to the test suite???

Edit: running ./vendor/bin/phpunit delivers same output.

0 likes
3 replies
deepu07's avatar

@ekn did you add this line in your code?

// config/app.php

'providers' => [
    ...

    Barryvdh\Cors\ServiceProvider::class,

],
ekn's avatar
Level 1

@deepu07 no. I had it there before but removed it because now it is covered by Fruitcake\Cors.

ekn's avatar
ekn
OP
Best Answer
Level 1

Turns out my Search function did not check into /bootstrap/cache/ where still the old Barryvdh\\Cors\\ServiceProvider was referenced several times. Deleting also them solved the problem!

Please or to participate in this conversation.