*/ public function toArray($request) { return [ 'id' => $this->id, 'name' => $this->name, 'is_filterable' => $this->is_filterable, 'activities' => $this->activities->pluck('id')->toArray(), 'links' => [ 'show' => route('api.subactivity.show', ['subactivity' => $this->getModel()]), 'update' => route('api.subactivity.update', ['subactivity' => $this->getModel()]), ], ]; } /** * @return array */ public static function meta(): array { return [ 'activities' => ActivityResource::collectionWithoutMeta(Activity::get()), ]; } }