Laravel-medialibrary: Class 'Spatie\MediaLibrary\Media' not found

Created on 21 Mar 2018  路  4Comments  路  Source: spatie/laravel-medialibrary

Just updating from 6.6 to 7. and getting error in Laravel 5.6: MediaLibraryServiceProvider.php line 30:

Class 'Spatie\MediaLibrary\Media' not found

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

Most helpful comment

ah, updated the model in config/medialibrary.php file

All 4 comments

Try to clear bootstrap/cache directory.

Please refer to the UPGRADING guide https://github.com/spatie/laravel-medialibrary/blob/master/UPGRADING.md#from-v6-to-v7

The model class has been moved to the Spatie\MediaLibrary\Models\Media FQCN.

ah, updated the model in config/medialibrary.php file

I'd the same issue, locally it was fixed by editing the config/medialibrary.php file but when deploying I was keep getting the error because php artisan config:clear kept failing. Removing the cached config file manually solved the problem: rm bootstrap/cache/config.php.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kickthemooon picture kickthemooon  路  4Comments

Radiergummi picture Radiergummi  路  4Comments

intrepidws picture intrepidws  路  3Comments

denitsa-md picture denitsa-md  路  3Comments

stayallive picture stayallive  路  4Comments