Skip to content

Commit

Permalink
Check if exists busyFrom()
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudio-Emmolo committed Sep 24, 2024
1 parent 2903e58 commit 019c628
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/App/Http/Controllers/BusyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 019c628

Please sign in to comment.