Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function slug($string, $seperator = '-')
 {
     return Str::slug($string, $seperator);
 }
Esempio n. 2
0
 /**
  * Get an item from an array using "dot" notation.
  *
  * @param \ArrayAccess|array $array
  * @param string             $key
  * @param mixed              $default
  *
  * @return mixed
  */
 public static function get($array, $key, $default = null)
 {
     if (!static::accessible($array)) {
         return Str::value($default);
     }
     if (is_null($key)) {
         return $array;
     }
     if (static::exists($array, $key)) {
         return $array[$key];
     }
     foreach (explode('.', $key) as $segment) {
         if (static::accessible($array) && static::exists($array, $segment)) {
             $array = $array[$segment];
         } else {
             return Str::value($default);
         }
     }
     return $array;
 }
Esempio n. 3
0
 /**
  * Get the class name of a migration name.
  *
  * @param string $name
  *
  * @return string
  */
 protected function getClassName($name)
 {
     return Str::studly($name);
 }
Esempio n. 4
0
 /**
  * Get the bearer token from the request headers.
  *
  * @return string|null
  */
 public function bearerToken()
 {
     $header = $this->header('Authorization', '');
     if (Str::startsWith($header, 'Bearer ')) {
         return Str::substr($header, 7);
     }
 }