Hello, i'm getting an error when i'm trieing to install the package:
Class name must be a valid object or a string
at C:\xampp\htdocs\powerproject\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()
C:\xampp\htdocs\powerproject\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:32
2 call_user_func_array([])
C:\xampp\htdocs\powerproject\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.
Hello guys. I'm also having this same issue. Composer revert didn't work and I'm stuck.
Hello, i'm getting an error when i'm trieing to install the package:
Class name must be a valid object or a string
at C:\xampp\htdocs\powerproject\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()
C:\xampp\htdocs\powerproject\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:322 call_user_func_array([])
C:\xampp\htdocs\powerproject\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:32Please use the argument -v to see more details.
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1Installation failed, reverting ./composer.json to its original content.
go to bootstrap/cache and delete config.php, packages.php services.php.
Then install an older version of the library.
I installed 7.14.0 and it works
Hello, i'm getting an error when i'm trieing to install the package:
Class name must be a valid object or a string
at C:\xampp\htdocs\powerproject\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()
C:\xampp\htdocs\powerproject\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:32
2 call_user_func_array([])
C:\xampp\htdocs\powerproject\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.go to bootstrap/cache and delete config.php, packages.php services.php.
Then install an older version of the library.
I installed 7.14.0 and it works
Been having the same issue and this worked.
In case future readers don't know, the way to install specific packages versions is by removing the '^', like this:
composer require "spatie/laravel-medialibrary:7.14.0"
Dear contributor,
because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.
Most helpful comment
Been having the same issue and this worked.
In case future readers don't know, the way to install specific packages versions is by removing the '^', like this:
composer require "spatie/laravel-medialibrary:7.14.0"