]> _ Git - cubist_cms-back.git/commitdiff
#2783
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 24 May 2019 14:45:27 +0000 (16:45 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 24 May 2019 14:45:27 +0000 (16:45 +0200)
src/app/Magic/Fields/Field.php
src/app/Magic/Fields/Slug.php [new file with mode: 0644]
src/app/Magic/Fields/Text.php [new file with mode: 0644]

index e362e13b82d14f00de171dfc91a691c53b212c65..c0798196c30b7bc507d014cc15b4bcec0f9c9ce9 100644 (file)
@@ -5,6 +5,7 @@ namespace Cubist\Backpack\app\Magic\Fields;
 
 use Cubist\Backpack\app\Magic\CubistMagicAttribute;
 use Exception;
+use Illuminate\Support\Str;
 
 class Field
 {
@@ -33,6 +34,13 @@ class Field
 
     protected static function _getClass($type)
     {
+        $type = Str::studly($type);
+        if (class_exists($type)) {
+            return $type;
+        }
+        if (class_exists(__NAMESPACE__ . '\\' . $type)) {
+            return __NAMESPACE__ . '\\' . $type;
+        }
         return self::class;
     }
 
diff --git a/src/app/Magic/Fields/Slug.php b/src/app/Magic/Fields/Slug.php
new file mode 100644 (file)
index 0000000..0043f64
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+
+namespace Cubist\Backpack\app\Magic\Fields;
+
+class Slug extends Field
+{
+
+}
diff --git a/src/app/Magic/Fields/Text.php b/src/app/Magic/Fields/Text.php
new file mode 100644 (file)
index 0000000..c7ede13
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+
+namespace Cubist\Backpack\app\Magic\Fields;
+
+class Text extends Field
+{
+
+}