Illuminate\Routing\Router::getLastGroupPrefix PHP Method

getLastGroupPrefix() public method

Get the prefix from the last group on the stack.
public getLastGroupPrefix ( ) : string
return string
    public function getLastGroupPrefix()
    {
        if (!empty($this->groupStack)) {
            $last = end($this->groupStack);
            return isset($last['prefix']) ? $last['prefix'] : '';
        }
        return '';
    }

Usage Example

 /**
  * Get the resource name for a grouped resource.
  *
  * @param  string  $prefix
  * @param  string  $resource
  * @param  string  $method
  * @return string
  */
 protected function getGroupResourceName($prefix, $resource, $method)
 {
     $group = trim(str_replace('/', '.', $this->router->getLastGroupPrefix()), '.');
     if (empty($group)) {
         return trim("{$prefix}{$resource}.{$method}", '.');
     }
     return trim("{$prefix}{$group}.{$resource}.{$method}", '.');
 }
All Usage Examples Of Illuminate\Routing\Router::getLastGroupPrefix