简体   繁体   中英

Laravel: Migration error on Deploy

I want to deploy one of my projects where I used custom blueprint.

On php artisan migrate I got the following error:

[Symfony\\Component\\Debug\\Exception\\FatalThrowableError]
Class 'Database\\CustomBlueprint' not found

I tried composer dumpautoload and I got this message:

Generating optimized autoload files

Illuminate\\Foundation\\ComposerScripts::postAutoloadDump

You made a reference to a non-existent script @php artisan package:discover

The last row didn't appeared on the local environment.

After dumpautoload the migrate command made the same result.

In fact it really depends where you have CustomBlueprint located. In the error there is Database\\CustomBlueprint but remember database directory is not PSR-4 directory by default.

It's quite possible that's enough to remove Database from namespace part from your CustomBlueprint and do the same in your migration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM