label('Tambah') ->modalHeading('Tambah Pengumuman') ->modalSubmitActionLabel('Simpan') ->modalCancelActionLabel('Batal') ->extraModalFooterActions(fn (CreateAction $action): array => [ $action->makeModalSubmitAction('createAnother', arguments: ['another' => true]) ->label('Simpan dan Tambah Lagi'), ]) ->modalWidth(Width::TwoExtraLarge) ->after(function (array $data) { if ($data['type'] === AnnouncementType::PUBLIC) { return; } $payload = [ 'title' => $data['title'], 'body' => $data['content'], ]; $userIds = Company::whereIn( 'id', PartnerMedia::whereIn('id', $data['partnerMedia'])->pluck('company_id') )->pluck('user_id'); User::whereIn('id', $userIds)->each(function ($user) use ($payload) { $user->notify(new BroadcastNotification($payload)); }); }), ]; } }