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
a2d272e4
Commit
a2d272e4
authored
Oct 18, 2014
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring the all method
parent
f4851348
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
SettingController.php
Http/Controllers/Admin/SettingController.php
+1
-6
EloquentSettingRepository.php
Repositories/Eloquent/EloquentSettingRepository.php
+12
-0
No files found.
Http/Controllers/Admin/SettingController.php
View file @
a2d272e4
...
...
@@ -23,12 +23,7 @@ class SettingController extends AdminBaseController
public
function
index
()
{
$rawSettings
=
$this
->
setting
->
all
();
$settings
=
[];
foreach
(
$rawSettings
as
$setting
)
{
$settings
[
$setting
->
name
]
=
$setting
;
}
$settings
=
$this
->
setting
->
all
();
return
View
::
make
(
'setting::admin.settings'
,
compact
(
'settings'
));
}
...
...
Repositories/Eloquent/EloquentSettingRepository.php
View file @
a2d272e4
...
...
@@ -24,6 +24,18 @@ class EloquentSettingRepository extends EloquentBaseRepository implements Settin
{
}
public
function
all
()
{
$rawSettings
=
parent
::
all
();
$settings
=
[];
foreach
(
$rawSettings
as
$setting
)
{
$settings
[
$setting
->
name
]
=
$setting
;
}
return
$settings
;
}
/**
* Create or update the settings
* @param $settings
...
...
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