FEATURE: add enumeration class for custom field types
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Enumerations;
|
||||||
|
|
||||||
|
use App\Models\CustomFieldType;
|
||||||
|
|
||||||
|
class CustomFieldTypes extends BaseEnumeration {
|
||||||
|
public static function getWithTranslations() {
|
||||||
|
|
||||||
|
// load items from database
|
||||||
|
$types = CustomFieldType::all(['id', 'name']);
|
||||||
|
|
||||||
|
// push items into collection
|
||||||
|
foreach ($types as $type) {
|
||||||
|
self::push($type->id, $type->name);
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent::getWithTranslations();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user