Esempio n. 1
0
 /**
  * Create a new driver instance.
  *
  * @param  string  $driver
  * @return mixed
  *
  * @throws \InvalidArgumentException
  */
 protected function createDriver($driver)
 {
     $method = 'create' . Str::studly($driver) . 'Driver';
     // We'll check to see if a creator method exists for the given driver. If not we
     // will check for a custom driver creator, which allows developers to create
     // drivers using their own customized driver creator Closure to create it.
     if (isset($this->customCreators[$driver])) {
         return $this->callCustomCreator($driver);
     } elseif (method_exists($this, $method)) {
         return $this->{$method}();
     }
     throw new InvalidArgumentException("Driver [{$driver}] not supported.");
 }
Esempio n. 2
0
 /**
  * Forget all of the pushed listeners.
  *
  * @return void
  */
 public function forgetPushed()
 {
     foreach ($this->listeners as $key => $value) {
         if (Str::endsWith($key, '_pushed')) {
             $this->forget($key);
         }
     }
 }
Esempio n. 3
0
 /**
  * Convert a value to title case.
  *
  * @param  string  $value
  * @return string
  */
 function title_case($value)
 {
     return Str::title($value);
 }