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

Reankidd24's avatar

php artisan migrate error

Hello guys, I have an error when doing php artisan migrate. on the terminal an error appears: In AppServiceProvider.php line 16:

  Class 'App \ Providers \ Schema' not found

I have added before Schema :: defaultStringLength (191); on AppServiceProvider.php what's the solution?

0 likes
2 replies
bobbybouwmann's avatar

You need to import the schema in your service provider. At this at this top of the AppServiceProvider.php file

use Illuminate\Support\Facades\Schema;
Snapey's avatar

Or only set string length of 191 on strings that are unique or have to be indexed. Why make all strings 191 ?

Please or to participate in this conversation.