这是我的控制器: As seen in the screenshot,the class exists and is in the correct place: My api.php routegave me the following error: Target class [Api\RegisterController] does not exist. ---- Update: Thanks的答案我决定对此路由使用完全限定的类名,但还有答案中描述的其他选项
这是PagesController.php的代码: public function index() return view("pages.index");}
routes/web.php的代码中添加了use语句,但它仍然显示PagesController,并且我的RouteServiceProvider.php中的默认命名空间是‘App\Http\Controlers.’。文件结构也是正确的
我在我的laravel应用程序中使用资源控制器,我试图使用依赖注入,但它不工作在特定的模型和控制器上。这样做是可行的:* Display the specified resource.* @param \App\Booking $booking*/
public function show(Booking