php - Laravel Intervention ImageServiceProvider not found

523

I'm facing a problem with my online environment, on my localhost using Laragon, everything worked without any problems.

My online environment
-- My composer version 1.8.5
-- My laravel version 5.8
-- My PHP version 7.3.0
-- Fileinfo support enable
-- GD Support enabled / Version bundled (2.1.0 compatible)
-- No Imagick PHP extension installed

I followed exactly the installation instructions on the official website.

  1. php composer.phar require intervention/image
  2. Add config/app.php $providers: Intervention\Image\ImageServiceProvider::class
  3. Add config/app.php $alias: 'Image' => Intervention\Image\Facades\Image::class

The problem starts now. When I try to run the statement:

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

I get the following message

[[email protected] portal]$ php artisan vendor:publish --provider="Intervention\Image\ImageServiceProviderLaravel5"

In ProviderRepository.php line 208:
Class 'Intervention\Image\ImageServiceProvider' not found

Dump-autoload command, I get the following return:

[[email protected] ~]$ php composer.phar dump-autoload
Generated autoload files containing 0 classes

Optimized dump-autoload command, I get the following return:

[[email protected] ~]$ php composer.phar dump-autoload -o
Generated optimized autoload files containing 156 classes

Here is part of my composer.json code

"require": {
   "php": "^7.1.3",
   "fideloper/proxy": "^4.0",
   "laravel/framework": "5.8.*",
   "laravel/tinker": "^1.0",
   "intervention/image": "dev-master"
},

Return of my composer update:

[[email protected] ~]$ php composer.phar update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files

Return of my composer install

[[email protected] ~]$ php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files

Return of the intervention image installation command

[[email protected] ~]$ php composer.phar require intervention/image
Using version ^2.4 for intervention/image
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files

The intervention folder is present in the project vendor folder

I have no idea what may be happening, in Internet search I also find no solution, always the same instructions that are the ones on the developer's own site.

438

Answer

Solution:

check if when installing intervention/image you were in the correct route of the project.

People are also looking for solutions to the problem: php - RegEx for capturing and replacing a string with quotes

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.