FEATURE: add seed and enumeration for action log types

This commit is contained in:
Michal Kváček
2016-01-28 17:01:54 +01:00
parent 703adfcb78
commit 0c7a138e43
4 changed files with 79 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
<?php
namespace App\Enumerations;
use App\Models\ActionLogType;
class ActionLogTypes extends BaseEnumeration
{
/**
* Init list of all action log types
*
* @throws Exceptions\EnumerationExistsException
*/
protected static function init()
{
$types = ActionLogType::all(['id', 'name']);
foreach ($types as $type) {
self::push($type->id, $type->name);
}
}
}