Illuminate\Contracts\Container\BindingResolutionException
Target class [Barryvdh\Cors\HandleCors] does not exist.
我们在使用laravel8框架安装barryvdh/laravel-cors扩展的时候,在app/Http/Kernel.php 的 protected $middleware 中添加\Barryvdh\Cors\HandleCors::class会报错。
解决方法就是改成在/app/Http/Kernel.php $routeMiddleware下添加
'cors' => \Barryvdh\Cors\Middleware\HandleCors::class,
文章评论(0)