File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ protected function getStandardClasses()
90
90
$ class = \Illuminate \Support \Str::of ($ item ['path ' ])
91
91
->after ('View/Components/ ' )
92
92
->replace ('.php ' , '' )
93
+ ->replace ('/ ' , '\\' )
93
94
->prepend ($ appNamespace . 'View \\Components \\' )
94
95
->toString ();
95
96
@@ -98,7 +99,7 @@ protected function getStandardClasses()
98
99
}
99
100
100
101
$ reflection = new \ReflectionClass ($ class );
101
- $ parameters = collect ($ reflection ->getConstructor ()->getParameters ())
102
+ $ parameters = collect ($ reflection ->getConstructor ()? ->getParameters() ?? [] )
102
103
->filter (fn ($ p ) => $ p ->isPromoted ())
103
104
->flatMap (fn ($ p ) => [$ p ->getName () => $ p ->isOptional () ? $ p ->getDefaultValue () : null ])
104
105
->all ();
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ $components = new class {
90
90
$class = \\Illuminate\\Support\\Str::of($item['path'])
91
91
->after('View/Components/')
92
92
->replace('.php', '')
93
+ ->replace('/', '\\\\')
93
94
->prepend($appNamespace . 'View\\\\Components\\\\')
94
95
->toString();
95
96
@@ -98,7 +99,7 @@ $components = new class {
98
99
}
99
100
100
101
$reflection = new \\ReflectionClass($class);
101
- $parameters = collect($reflection->getConstructor()->getParameters())
102
+ $parameters = collect($reflection->getConstructor()? ->getParameters() ?? [] )
102
103
->filter(fn($p) => $p->isPromoted())
103
104
->flatMap(fn($p) => [$p->getName() => $p->isOptional() ? $p->getDefaultValue() : null])
104
105
->all();
You can’t perform that action at this time.
0 commit comments