@@ -60,12 +60,37 @@ private function missingValues(): array
6060 $ required = $ this ->requiredValues ();
6161
6262 return [
63+ ...$ this ->missingDefaultValues (),
6364 ...array_intersect_key ($ required , array_flip (Configured ::missing (array_keys ($ required )))),
6465 ...$ this ->missingMercureValues (),
6566 ...$ this ->missingMailValues (),
6667 ];
6768 }
6869
70+ /**
71+ * Get default driver keys without a usable value, mapped to the feature that needs them.
72+ *
73+ * The managers read these keys with typed getters, so a blank or null
74+ * value fails at runtime instead of falling back to a default driver.
75+ *
76+ * @return array<string, string>
77+ */
78+ private function missingDefaultValues (): array
79+ {
80+ $ defaults = [
81+ 'broadcasting.default ' => 'default broadcaster ' ,
82+ 'filesystems.default ' => 'default filesystem disk ' ,
83+ 'mail.default ' => 'default mailer ' ,
84+ 'queue.default ' => 'default queue connection ' ,
85+ ];
86+
87+ return array_filter (
88+ $ defaults ,
89+ static fn (string $ key ): bool => Configured ::string ($ key ) === null ,
90+ ARRAY_FILTER_USE_KEY ,
91+ );
92+ }
93+
6994 /**
7095 * Get configuration keys required by the active drivers, mapped to the feature that needs them.
7196 *
@@ -88,7 +113,12 @@ private function requiredValues(): array
88113 */
89114 private function broadcastingValues (): array
90115 {
91- $ connection = Configured ::string ('broadcasting.default ' , 'null ' );
116+ $ connection = Configured ::string ('broadcasting.default ' );
117+
118+ if ($ connection === null ) {
119+ return [];
120+ }
121+
92122 $ driver = Configured ::string ("broadcasting.connections. {$ connection }.driver " , $ connection );
93123
94124 $ keys = match ($ driver ) {
@@ -107,7 +137,12 @@ private function broadcastingValues(): array
107137 */
108138 private function missingMercureValues (): array
109139 {
110- $ connection = Configured ::string ('broadcasting.default ' , 'null ' );
140+ $ connection = Configured ::string ('broadcasting.default ' );
141+
142+ if ($ connection === null ) {
143+ return [];
144+ }
145+
111146 $ prefix = "broadcasting.connections. {$ connection }" ;
112147
113148 if (Configured ::string ("{$ prefix }.driver " , $ connection ) !== 'mercure ' ) {
@@ -142,9 +177,9 @@ private function missingMercureValues(): array
142177 */
143178 private function filesystemValues (): array
144179 {
145- $ disk = Configured ::string ('filesystems.default ' , ' local ' );
180+ $ disk = Configured ::string ('filesystems.default ' );
146181
147- if (Configured ::string ("filesystems.disks. {$ disk }.driver " , $ disk ) !== 's3 ' ) {
182+ if ($ disk === null || Configured ::string ("filesystems.disks. {$ disk }.driver " , $ disk ) !== 's3 ' ) {
148183 return [];
149184 }
150185
@@ -158,9 +193,16 @@ private function filesystemValues(): array
158193 */
159194 private function loggingValues (): array
160195 {
196+ $ default = Configured ::string ('logging.default ' );
197+
198+ // The default log channel is optional; without one, LogManager writes to its emergency logger.
199+ if ($ default === null ) {
200+ return [];
201+ }
202+
161203 $ values = [];
162204
163- foreach (ActiveDrivers ::logChannels (Configured :: string ( ' logging. default' , ' stack ' ) ) as $ channel ) {
205+ foreach (ActiveDrivers ::logChannels ($ default ) as $ channel ) {
164206 $ values = [...$ values , ...$ this ->logChannelValues ($ channel )];
165207 }
166208
@@ -206,9 +248,15 @@ private function logChannelValues(string $channel): array
206248 */
207249 private function missingMailValues (): array
208250 {
251+ $ default = Configured ::string ('mail.default ' );
252+
253+ if ($ default === null ) {
254+ return [];
255+ }
256+
209257 $ values = [];
210258
211- foreach (ActiveDrivers ::mailers (Configured :: string ( ' mail. default' , ' log ' ) ) as $ mailer ) {
259+ foreach (ActiveDrivers ::mailers ($ default ) as $ mailer ) {
212260 $ values = [...$ values , ...$ this ->missingMailerValues ($ mailer )];
213261 }
214262
@@ -266,7 +314,12 @@ private function missingMailerValues(string $mailer): array
266314 */
267315 private function queueValues (): array
268316 {
269- $ connection = Configured ::string ('queue.default ' , 'database ' );
317+ $ connection = Configured ::string ('queue.default ' );
318+
319+ if ($ connection === null ) {
320+ return [];
321+ }
322+
270323 $ values = [];
271324
272325 foreach (ActiveDrivers ::queueConnections ($ connection ) as $ name ) {
0 commit comments