refactor: swap where('id', '=', ) for find()

This commit is contained in:
Roardom
2023-06-19 07:27:06 +00:00
parent bded8dd3e6
commit b5493c5642
40 changed files with 52 additions and 56 deletions
@@ -55,7 +55,7 @@ class ChatBotController extends Controller
*/
public function update(UpdateChatBotRequest $request, int $id): \Illuminate\Http\RedirectResponse
{
Bot::where('id', '=', $id)->update($request->validated());
Bot::findOrFail($id)->update($request->validated());
return to_route('staff.bots.edit', ['id' => $id])
->withSuccess("The Bot Has Been Updated");