Hi,
After installation with composer, i receive an error:
Symfony\Component\Debug\Exception\FatalThrowableError : Class name must be a valid object or a string at /var/www/html/vendor/spatie/laravel-medialibrary/src/MediaLibraryServiceProvider.php:33
29| ], 'views');
30|
31| $mediaClass = config('medialibrary.media_model');
32|
33| $mediaClass::observe(new MediaObserver());
34|
35| $this->loadViewsFrom(__DIR__.'/../resources/views', 'medialibrary');
36| }
37|
Exception trace:
1 Spatie\MediaLibrary\MediaLibraryServiceProvider::boot()
/var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:32
2 call_user_func_array([])
/var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:32
Please use the argument -v to see more details.
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
Installation failed, reverting ./composer.json to its original content.
+1 here. php v7.4.1
> @php artisan package:discover --ansi
Symfony\Component\Debug\Exception\FatalThrowableError : Class name must be a valid object or a string
at C:\Users\Mevlut Canvar\temp-repos\congress\vendor\spatie\laravel-medialibrary\src\MediaLibraryServiceProvider.php:33
29| ], 'views');
30|
31| $mediaClass = config('medialibrary.media_model');
32|
> 33| $mediaClass::observe(new MediaObserver());
34|
35| $this->loadViewsFrom(__DIR__.'/../resources/views', 'medialibrary');
36| }
37|
I had this same problem on server with php 7.4.2 and removing config cache manually resolved this issue by running this command: rm bootstrap/cache/config.php
Most helpful comment
I had this same problem on server with php 7.4.2 and removing config cache manually resolved this issue by running this command:
rm bootstrap/cache/config.php