Skip to content

Commit

Permalink
Fixing the issue with resource route and group prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc committed Oct 8, 2015
1 parent a2c04e6 commit 897b163
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Routing/ResourceRegistrar.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ class ResourceRegistrar extends IlluminateResourceRegistrar
*/
protected function getGroupResourceName($prefix, $resource, $method)
{
$group = trim(str_replace('/', '.', $this->router->getLastGroupPrefix()), '.');
$currentLocale = localization()->getCurrentLocale();
$group = trim(str_replace('/', '.', $this->router->getLastGroupPrefix()), '.');
$group = str_replace($currentLocale . '.', '', $group);

if ( ! empty($group) && $group !== localization()->getCurrentLocale()) {
if ( ! empty($group) && $group !== $currentLocale) {
return trim("{$prefix}{$group}.{$resource}.{$method}", '.');
}

Expand Down

1 comment on commit 897b163

@arcanedev-maroc
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix for #5 and #9

Please sign in to comment.