我需要使用AND運算符來檢查我的表中的數據在Laravel和查看此類似如何Laravel比較行數據5.2
if(Permission::where('status', '=', '1')->first()) AND (Permission::where('project_id', '=', '$id')->first())return view('collaborators.show')->withProject($project)->withTasks($tasks)->withFiles($files)->withComments($comments)->withCollaborators($collaborators);
else
return('hi');
,但我發現了以下錯誤
syntax error, unexpected 'else' (T_ELSE)
你的代碼工作,但$ id變量不許可標識::在哪裏( 'PROJECT_ID', '=', '的$ id') - >第()) – Fernando
我只是固定的語法。其餘代碼保持不變。你應該改變''$ id''到'$ id'(去掉撇號) – Skysplit
我做到了,但結果相同..... – Fernando