未找到 Laravel 5 类“Intervention\Image\ImageServiceProvider”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/34475855/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 12:53:55  来源:igfitidea点击:

Laravel 5 Class 'Intervention\Image\ImageServiceProvider' not found

phplaravelcomposer-php

提问by Stanis?aw Szewczyk

Hi I have problem with Intervention Image. When I use composer updateor

嗨,我有干预图像的问题。当我使用composer update

php artisan vendor:publish --provider="Intervention\Image\ImageServiceProviderLaravel5"

I have error:

我有错误:

[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Intervention\Image\ImageServiceProvider' not found**

[Symfony\Component\Debug\Exception\FatalErrorException]
找不到类“Intervention\Image\ImageServiceProvider”**

Have you idea? I did everything from http://image.intervention.io/getting_started/installationand I don't know what should I do now, please help me :)

你有想法吗?我从http://image.intervention.io/getting_started/installation做了所有事情,但我不知道我现在应该做什么,请帮帮我 :)

回答by Marcin Nabia?ek

Have you followed installation guide carefully ?

您是否仔细遵循安装指南?

You need to first run:

您需要先运行:

composer require intervention/image

and you should modify config.app.phpafter you already install this package (so after composer require) and not before.

并且你应该config.app.php在你已经安装这个包之后进行修改(所以在之后composer require)而不是之前。

回答by Sad?k Menduh A?ar

I solved by running

我通过运行解决了

php artisan config:clear

than: php artisan vendor:publish --provider="Intervention\Image\ImageServiceProviderLaravel5"

比: php artisan vendor:publish --provider="Intervention\Image\ImageServiceProviderLaravel5"