$this->name, 'id' => $this->id, 'subactivities' => $this->subactivities->pluck('id')->toArray(), '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')), ]; } }