-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
82b9bd3
commit f280021
Showing
5 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php namespace Arcanedev\Localization\Routing; | ||
|
||
use Illuminate\Routing\ResourceRegistrar as IlluminateResourceRegistrar; | ||
|
||
/** | ||
* Class ResourceRegistrar | ||
* | ||
* @package Arcanedev\Localization\Routing | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
class ResourceRegistrar extends IlluminateResourceRegistrar | ||
{ | ||
/* ------------------------------------------------------------------------------------------------ | ||
| Main Functions | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* 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) && $group !== localization()->getCurrentLocale()) { | ||
return trim("{$prefix}{$group}.{$resource}.{$method}", '.'); | ||
} | ||
|
||
return trim("{$prefix}{$resource}.{$method}", '.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php namespace Arcanedev\Localization\Tests\Stubs\Http\Controllers; | ||
|
||
use Illuminate\Routing\Controller; | ||
|
||
/** | ||
* Class BarController | ||
* | ||
* @package Arcanedev\Localization\Tests\Stubs\Http\Controllers | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
class BarController extends Controller | ||
{ | ||
// | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php namespace Arcanedev\Localization\Tests\Stubs\Http\Controllers; | ||
|
||
use Illuminate\Routing\Controller; | ||
|
||
/** | ||
* Class DummyController | ||
* | ||
* @package Arcanedev\Localization\Tests\Stubs\Http\Controllers | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
class DummyController extends Controller | ||
{ | ||
// | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters