$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(), ], 'members' => Member::ordered()->get()->map(fn ($member) => ['id' => $member->id, 'name' => $member->fullname]), 'gateways' => Mailgateway::pluck('name', 'id'), ]; } }