/**
  * Determine the URI from the given method name.
  *
  * @param  string  $name
  * @param  string  $prefix
  * @return string
  */
 public function getPlainUri($name, $prefix)
 {
     return $prefix . '/' . implode('-', array_slice(explode('_', Inflector::tableize($name)), 1));
 }
示例#2
0
 /**
  * Get the Table for the Model.
  *
  * @return string
  */
 public function getTable()
 {
     if (isset($this->table)) {
         return $this->table;
     }
     $baseName = class_basename($this);
     return str_replace('\\', '', Inflector::tableize($baseName));
 }
 /**
  * Make FileName.
  *
  * @param string $filePath
  *
  * @return string
  */
 protected function makeFileName($filePath)
 {
     return date('Y_m_d_His') . '_' . strtolower(Inflector::tableize(basename($filePath)));
 }
示例#4
0
 /**
  * Register a custom implicit Validator extension.
  *
  * @param  string   $rule
  * @param  \Closure|string  $extension
  * @param  string  $message
  * @return void
  */
 public function extendImplicit($rule, $extension, $message = null)
 {
     $this->implicitExtensions[$rule] = $extension;
     if ($message !== null) {
         $rule = Inflector::tableize($rule);
         $this->fallbackMessages[$rule] = $message;
     }
 }
示例#5
0
 /**
  * Determines if the given module exists.
  *
  * @param string $slug
  *
  * @return bool
  */
 public function exists($slug)
 {
     $slug = Inflector::tableize($slug);
     $slugs = $this->slugs()->toArray();
     return in_array($slug, $slugs);
 }