@@ -84,7 +84,7 @@ class Response implements Responsable
8484 /**
8585 * Create a new Inertia response instance.
8686 *
87- * @param array<string, mixed> $props
87+ * @param array<int| string, mixed|\Inertia\ProvidesInertiaProperties > $props
8888 */
8989 public function __construct (
9090 string $ component ,
@@ -216,6 +216,9 @@ public function resolveProperties(Request $request, array $props): array
216216
217217 /**
218218 * Resolve the ProvidesInertiaProperties props.
219+ *
220+ * @param array<string, mixed> $props
221+ * @return array<string, mixed>
219222 */
220223 public function resolveInertiaPropsProviders (array $ props , Request $ request ): array
221224 {
@@ -226,10 +229,9 @@ public function resolveInertiaPropsProviders(array $props, Request $request): ar
226229 foreach ($ props as $ key => $ value ) {
227230 if (is_numeric ($ key ) && $ value instanceof ProvidesInertiaProperties) {
228231 // Pipe into a Collection to leverage Collection::getArrayableItems()
229- $ newProps = array_merge (
230- $ newProps ,
231- collect ($ value ->toInertiaProperties ($ renderContext ))->all ()
232- );
232+ /** @var array<string, mixed> $inertiaProps */
233+ $ inertiaProps = collect ($ value ->toInertiaProperties ($ renderContext ))->all ();
234+ $ newProps = array_merge ($ newProps , $ inertiaProps );
233235 } else {
234236 $ newProps [$ key ] = $ value ;
235237 }
0 commit comments