From 019c62887b4f60601a2884696d9fe8e11bd6853a Mon Sep 17 00:00:00 2001 From: Claudio-Emmolo <113107618+Claudio-Emmolo@users.noreply.github.com> Date: Tue, 24 Sep 2024 09:52:30 +0200 Subject: [PATCH] Check if exists busyFrom() --- src/App/Http/Controllers/BusyController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/App/Http/Controllers/BusyController.php b/src/App/Http/Controllers/BusyController.php index 3ecf149..148f6b4 100644 --- a/src/App/Http/Controllers/BusyController.php +++ b/src/App/Http/Controllers/BusyController.php @@ -16,6 +16,10 @@ public function storeBusy(Request $request) return; } $resource = $this->getResource($request['model-id'], $request['model-name']); + //check if the $resource has a busyFrom method, if not, return + if (! method_exists($resource, 'busyFrom')) { + return; + } $user = \App\Models\User::find($request['user-id']); $resource->busyFrom($user); }