通过ServiceContainer, ServiceProvider, 建立了一个自定义的服务,请问如何在服务中使用依赖注入,比如 Request, User,Cookie等
如果直接在服务的方法中写入User $user ,提示如下:
Argument 1 passed to App\Services\UserService::register() must be an instance of App\User, none given, called in /home/vagrant/Code/zhicheauto/car-server/app/Api/Controllers/UsersController.php on line 32 and defined
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
没引入?
use App\User