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

@param String $name
@return numeric
get log type by name