$this->name, 'id' => $this->id, 'subactivities' => $this->subactivities->pluck('id')->toArray(), 'is_filterable' => $this->is_filterable, 'links' => [ 'edit' => route('activity.edit', ['activity' => $this->getModel()]), 'update' => route('activity.update', ['activity' => $this->getModel()]), 'destroy' => route('activity.destroy', ['activity' => $this->getModel()]), ], ]; } /** * @return array */ public static function meta(): array { return [ 'subactivities' => Subactivity::select('name', 'id')->get(), 'filter' => ActivityFilterScope::fromRequest(request()->input('filter')), ]; } }