我使用Laravel的请求创建了一个用于创建和编辑表单的验证。 但我使用相同的表单来创建和编辑。因此,我创建了一个例外,以便当url id等于数据库中注册的id时,允许插入配置为唯一的字段。正如您所看到的,我使用片段从url中获取正在编辑的id,但它总是返回null public function rules() $id = $this->segment(3);
在将文件上传到laravel时,我遇到了问题,它的pdf或图像总是返回到null{!!对成员函数的调用--在null上移动()
public function store(Request $request) $this('device_document');
return redirect('/transactionsi
这是我的控制器: As seen in the screenshot,the class exists and is in the correct place: My api.php route: When I hit my register route using Postman,it gave me the following error: Target class [Api\RegisterController] does not exist. ---- Update: Thanks的答案,我能够解决它。我决定对此路由使用完全限定的类名,但还有答案中描述的其他选项。