Skip to content

Commit ecc6855

Browse files
authored
Fix Blueprint::find with :: (#238)
* Fix blueprint find with :: * Oops * StyleCI
1 parent cf01e2d commit ecc6855

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Fields/BlueprintRepository.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ private function makeBlueprintFromModel($model)
105105

106106
protected function getNamespaceAndHandle($blueprint)
107107
{
108+
if (str_contains($blueprint, '::')) {
109+
$blueprint = explode('::', $blueprint);
110+
111+
return [$blueprint[0], $blueprint[1]];
112+
}
113+
108114
$blueprint = str_replace('/', '.', $blueprint);
109115
$parts = explode('.', $blueprint);
110116
$handle = array_pop($parts);
@@ -124,7 +130,7 @@ public function getModel($blueprint)
124130
public function updateModel($blueprint)
125131
{
126132
$model = app('statamic.eloquent.blueprints.blueprint_model')::firstOrNew([
127-
'handle' => $blueprint->handle(),
133+
'handle' => $blueprint->handle(),
128134
'namespace' => $blueprint->namespace() ?? null,
129135
]);
130136

0 commit comments

Comments
 (0)