protected function getActions($notices) { $actions = []; foreach ($notices as $notice) { $actions[] = $notice['action_type_id']; } return ActionType::unique($actions)->get()->each(function ($action) { $action->useAs('notice'); })->toIdArray(); }