Laravel Symfony\Component\Debug\Exception\FatalThroTableError语法错误,意外的“:”,应为“)”
我在谷歌上搜索了一下这个错误,我发现这似乎是EmployeeController中的一个错误,但我看不出我做了什么,这与我的其他工作模板不同。这是错误消息 Symfony\Component\Debug\Exception\FatalThroTableError 语法错误,意外的“:”,应为 这是我的EmployeeController@editLaravel Symfony\Component\Debug\Exception\FatalThroTableError语法错误,意外的“:”,应为“)”,laravel,laravel-6,Laravel,Laravel 6,我在谷歌上搜索了一下这个错误,我发现这似乎是EmployeeController中的一个错误,但我看不出我做了什么,这与我的其他工作模板不同。这是错误消息 Symfony\Component\Debug\Exception\FatalThroTableError 语法错误,意外的“:”,应为 这是我的EmployeeController@edit public function edit($id, $jabatan) { // gabisa pake findOrFail
public function edit($id, $jabatan)
{
// gabisa pake findOrFail karena ajax
// return response()->json($employees);
$employees = Employee::find($id);
if ($employees) {
if ((int) $jabatan == 0) {
$jabatan = Sallary::select(['id', 'nama_jabatan'])->get()->toArray();
} else $jabatan = [];
return $this->jsRespond(status: true, message: 'Berhasil ambil', [
'employee' => $employees->toArray(),
'jabatan' => $jabatan
]);
} else {
return $this->jsRespond(status: false, message: 'Data Gagal Diambil');
}
}
private function jsRespond($status, $message, $others = [])
{
return response()->json([
'status' => $status,
'message' => $message,
'others' => $others
]);
}
有人能帮我找出故障吗?状态:和消息:在->jsRespond。。。电话导致了错误。将其从通话中删除:
public function edit($id, $jabatan)
{
// gabisa pake findOrFail karena ajax
// return response()->json($employees);
$employees = Employee::find($id);
if ($employees) {
if ((int) $jabatan == 0) {
$jabatan = Sallary::select(['id', 'nama_jabatan'])->get()->toArray();
} else $jabatan = [];
return $this->jsRespond(true, 'Berhasil ambil', [
'employee' => $employees->toArray(),
'jabatan' => $jabatan
]);
} else {
return $this->jsRespond(false, 'Data Gagal Diambil');
}
}
private function jsRespond($status, $message, $others = [])
{
return response()->json([
'status' => $status,
'message' => $message,
'others' => $others
]);
}
从->jsRespond calls中删除状态:和消息:谢谢@溴啤酒-将你的评论作为答案/解决方案发布。@JohnHanley正要,不得不先喂猫;谢谢