laravel: 报错: Target class [view] does not exist.

一,报错信息:

Next Illuminate\\Contracts\\Container\\BindingResolutionException: 
Target class [view] does not exist. in /web/api/vendor/laravel/framework/src/Illuminate/Con
tainer/Container.php:940
Stack trace:
#0 /web/api/vendor/laravel/framework/src/Illuminate/Container/Container.php(815): Illuminate\\Container\\Container->build()
#1 /web/api/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1046): Illuminate\\Container\\Container->resolve()
#2 /web/api/vendor/laravel/framework/src/Illuminate/Container/Container.php(751): Illuminate\\Foundation\\Application->resolve() 

 上次出现时,vendor/laravel/ui因git冲突此目录下无文件,
这一次出现时,此目录下的库文件是存在的

二,解决:

执行下面两个命令后恢复正常:

php artisan package:discover

[lhd@web api]$ php artisan package:discover

   INFO  Discovering packages.

  laravel/sail ................................................................................................................................ DONE
  laravel/sanctum ............................................................................................................................. DONE
  laravel/tinker .............................................................................................................................. DONE
  laravel/ui .................................................................................................................................. DONE
  nesbot/carbon ............................................................................................................................... DONE
  nunomaduro/collision ........................................................................................................................ DONE
  nunomaduro/termwind ......................................................................................................................... DONE

 php artisan key:generate

[lhd@web api]$  php artisan key:generate


                                                                            APPLICATION IN PRODUCTION.


 ┌ Are you sure you want to run this command? ──────────────────┐
 │ Yes                                                          │
 └──────────────────────────────────────────────────────────────┘

   INFO  Application key set successfully.

 

posted @ 2024-09-26 15:53  刘宏缔的架构森林  阅读(53)  评论(0编辑  收藏  举报