29 public function getForAdministrator(?User $user = null, ?Group $group = null, ?Role $role = null): Collection
31 return $this->
active()->filter(
function($activity) use ($user, $group, $role) {
32 $logicTester = app()->make(LogicTester::class);
33 return $logicTester->evaluate($activity->adminLogic, $user, $group, $role);
47 return Activity::active()->enabled()->with([
51 'moduleInstances.activeLogic',
52 'moduleInstances.visibleLogic',
53 'moduleInstances.mandatoryLogic',
67 public function getForParticipant(?User $user = null, ?Group $group = null, ?Role $role = null): Collection
69 return $this->
active()->filter(
function($activity) use ($user, $group, $role) {
70 $logicTester = app()->make(LogicTester::class);
71 return $logicTester->evaluate($activity->forLogic, $user, $group, $role);
80 public function all(): Collection
82 return Activity::all();
107 return Activity::create($attributes);
121 return Activity::findOrFail($id);
148 $activity = $this->
getById($id);
149 $activity->fill($attributes);
162 public function delete($id)
164 return $this->
getById($id)->delete();
create(array $attributes)
getForParticipant(?User $user=null, ?Group $group=null, ?Role $role=null)
getForAdministrator(?User $user=null, ?Group $group=null, ?Role $role=null)