$this->name, 'gateway' => new MailgatewayResource($this->whenLoaded('gateway')), ]; } /** * @return array */ public static function meta(): array { return [ 'links' => [ 'create' => route('maildispatcher.create'), 'index' => route('maildispatcher.index'), ], 'default_model' => [ 'name' => '', 'gateway_id' => null, 'filter' => FilterScope::from([])->toArray(), ], 'activities' => Activity::pluck('name', 'id'), 'subactivities' => Subactivity::pluck('name', 'id'), 'members' => Member::ordered()->get()->map(fn ($member) => ['id' => $member->id, 'name' => $member->fullname]), 'groups' => Group::pluck('name', 'id'), 'gateways' => Mailgateway::pluck('name', 'id'), ]; } }