engine = (is_null($engine)) ? new BCrypt(10, false) : $engine; } /** * Create a new Hasher instance. * * If no hashing engine is provided, the BCrypt engine will be used. * * @param Engine $engine * @return Hasher */ public static function make(Engine $engine = null) { return new static($engine); } /** * Magic Method for delegating method calls to the hashing engine. * * * // Use the hashing engine to has a value * $hash = Hasher::make()->hash('password'); * * // Equivalent method using the engine property * $hash = Hasher::make()->engine->hash('password'); * */ public function __call($method, $parameters) { return call_user_func_array(array($this->engine, $method), $parameters); } /** * Magic Method for performing methods on the default hashing engine. * * * // Hash a value using the default hashing engine * $hash = Hasher::hash('password'); * */ public static function __callStatic($method, $parameters) { return call_user_func_array(array(static::make()->engine, $method), $parameters); } }