File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 66use Statamic \Facades \Blink ;
77use Statamic \Fields \Fieldset ;
88use Statamic \Fields \FieldsetRepository as StacheRepository ;
9+ use Statamic \Support \Str ;
910
1011class FieldsetRepository extends StacheRepository
1112{
@@ -18,8 +19,14 @@ public function all(): Collection
1819
1920 return $ models ->map (function ($ model ) {
2021 return Blink::once ("eloquent-fieldset- {$ model ->handle }" , function () use ($ model ) {
22+ $ handle = $ model ->handle ;
23+
24+ if (Str::startsWith ($ handle , 'vendor. ' )) {
25+ $ handle = Str::of ($ handle )->after ('vendor. ' )->replaceFirst ('. ' , ':: ' );
26+ }
27+
2128 return (new Fieldset )
22- ->setHandle ($ model -> handle )
29+ ->setHandle ($ handle )
2330 ->setContents ($ model ->data );
2431 });
2532 });
@@ -30,6 +37,10 @@ public function find($handle): ?Fieldset
3037 {
3138 $ handle = str_replace ('/ ' , '. ' , $ handle );
3239
40+ if (Str::startsWith ($ handle , 'vendor. ' )) {
41+ $ handle = Str::of ($ handle )->after ('vendor. ' )->replaceFirst ('. ' , ':: ' );
42+ }
43+
3344 return $ this ->all ()->filter (function ($ fieldset ) use ($ handle ) {
3445 return $ fieldset ->handle () == $ handle ;
3546 })->first ();
You can’t perform that action at this time.
0 commit comments