Exemple #1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $logTypesHelper = new LogTypes();
     $logTypes = $logTypesHelper->getLogTypes();
     foreach ($logTypes as $key => $value) {
         $logType = new LogType();
         $logType->key = $key;
         $logType->description = $value;
         $logType->save();
     }
 }
Exemple #2
0
 /**
  * Return log type id that match the given key
  *
  * @param string $key
  * @return int
  */
 public function getLogTypeId($key)
 {
     $logType = new LogType();
     $log = $logType->where('key', $key)->first();
     return $log->id;
 }