phplaravelcomposer-phplaravel-7

Target class [view] does not exist. in Container.php


I have a problem with laravel and I don't know how to fix it for now. Actually I don't know how I face this problem, but will try to explain you what I did and what I tried for now to fix the problem.

I tried composer update and this problem occured. Now I can not type any command like php artisan make:livewire name or even php artisan --version, everytime when I try to execute commands I receive this error in console

In Container.php line 811:
                                       
  Target class [view] does not exist.  
                                       

In Container.php line 809:
                             
  Class view does not exist 

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1 
                             

Also the information from the log file

[previous exception] [object] (ReflectionException(code: -1): Class view does not exist at /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php:809)
[stacktrace]
#0 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(809): ReflectionClass->__construct()
#1 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(691): Illuminate\\Container\\Container->build()
#2 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(796): Illuminate\\Container\\Container->resolve()
#3 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(637): Illuminate\\Foundation\\Application->resolve()
#4 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(781): Illuminate\\Container\\Container->make()
#5 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(1284): Illuminate\\Foundation\\Application->make()
#6 /var/www/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(198): Illuminate\\Container\\Container->offsetGet()
#7 /var/www/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(166): Illuminate\\Support\\Facades\\Facade::resolveFacadeInstance()
#8 /var/www/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(255): Illuminate\\Support\\Facades\\Facade::getFacadeRoot()
#9 /var/www/vendor/beyondcode/helo-laravel/src/HeloLaravelServiceProvider.php(41): Illuminate\\Support\\Facades\\Facade::__callStatic()
#10 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(627): BeyondCode\\HeloLaravel\\HeloLaravelServiceProvider->register()
#11 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php(75): Illuminate\\Foundation\\Application->register()
#12 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(604): Illuminate\\Foundation\\ProviderRepository->load()
#13 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php(17): Illuminate\\Foundation\\Application->registerConfiguredProviders()
#14 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(230): Illuminate\\Foundation\\Bootstrap\\RegisterProviders->bootstrap()
#15 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(310): Illuminate\\Foundation\\Application->bootstrapWith()
#16 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(127): Illuminate\\Foundation\\Console\\Kernel->bootstrap()
#17 /var/www/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle()
#18 {main}
"} 

Solutions I have been tried till now:

1.Delete vendor folder and type composer install again but at the final stage I received this error again.

2.Delete vendor and composer.lock still without success.

3.Cleaned boostrap/cache/*.php folder and run commands again, but it not worked again.

So any advice how to fix this problem will be appreciated. Laravel Version: 7


Solution

  • The whole problem was that, another developer had commented line Illuminate\View\ViewServiceProvider::class, inside config/app.php providers