protected function getLogTypeByName($name)
    {
        $type = LogTypes::where('name', $name)->first();
        if (is_null($type)) {
            $type = new LogTypes(['name' => $name]);
            $type->save();
        }
        return $type->id;
    }