I'm making a package in Laravel which requires another package. But I'm getting the following error
Fatal error: Class 'Spatie\\MediaLibrary\\MediaLibraryServiceProvider' not found
This is my folder structure
I included my fresh package to my composer, this looks as following
"psr-4": {
"App\\": "app/",
"Notflip\\Cld\\": "packages/Notflip/cld/src/"
}
This is what my service provider looks like
<?php namespace Notflip\Cld;
use Illuminate\Support\ServiceProvider;
class CldServiceProvider extends ServiceProvider {
public function register()
{
$this->app->register(\Spatie\MediaLibrary\MediaLibraryServiceProvider::class);
}
}
PHPStorm is complaining that there is multiple definitions of the ServiceProvider and the newly required package Spatie/ can't be found
Here's a screenshot for clarity
Any idea what I might be doing wrong?
Composer update --lock
将解决问题
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.