Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
d56e2291
Commit
d56e2291
authored
May 31, 2018
by
huy.dang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve code
parent
99d9c82e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
RoutingServiceProvider.php
Modules/Core/Providers/RoutingServiceProvider.php
+14
-6
No files found.
Modules/Core/Providers/RoutingServiceProvider.php
View file @
d56e2291
...
@@ -52,12 +52,7 @@ abstract class RoutingServiceProvider extends ServiceProvider
...
@@ -52,12 +52,7 @@ abstract class RoutingServiceProvider extends ServiceProvider
$this
->
loadApiRoutes
(
$router
);
$this
->
loadApiRoutes
(
$router
);
});
});
if
(
app
(
'asgard.isInstalled'
))
{
$prefixes
=
$this
->
getPrefixes
();
$prefixes
=
array_merge
(
json_decode
(
setting
(
'core::locales'
)),
[
''
]);
}
else
{
$prefixes
=
[
LaravelLocalization
::
setLocale
()];
}
foreach
(
$prefixes
as
$prefix
)
{
foreach
(
$prefixes
as
$prefix
)
{
$router
->
group
([
$router
->
group
([
'namespace'
=>
$this
->
namespace
,
'namespace'
=>
$this
->
namespace
,
...
@@ -70,6 +65,19 @@ abstract class RoutingServiceProvider extends ServiceProvider
...
@@ -70,6 +65,19 @@ abstract class RoutingServiceProvider extends ServiceProvider
}
}
}
}
/**
* Get locale prefixes
* @return array
*/
private
function
getPrefixes
()
{
if
(
app
(
'asgard.isInstalled'
))
{
return
array_merge
(
json_decode
(
setting
(
'core::locales'
)),
[
''
]);
}
return
[
LaravelLocalization
::
setLocale
()];
}
/**
/**
* @param Router $router
* @param Router $router
*/
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment