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
7380176e
Commit
7380176e
authored
Oct 02, 2014
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the filter in the admin controller. Add more documentation to the i18n helper
parent
b8efd041
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
AdminBaseController.php
Http/Controllers/Admin/AdminBaseController.php
+1
-1
Helper.php
Internationalisation/Helper.php
+10
-0
No files found.
Http/Controllers/Admin/AdminBaseController.php
View file @
7380176e
...
...
@@ -6,6 +6,6 @@ class AdminBaseController extends Controller
{
public
function
__construct
()
{
$this
->
beforeFilter
(
'
dashboard
'
);
$this
->
beforeFilter
(
'
auth.admin
'
);
}
}
\ No newline at end of file
Internationalisation/Helper.php
View file @
7380176e
...
...
@@ -23,6 +23,11 @@ class Helper
$model
->
save
();
}
/**
* Separate the input fields into their own language key
* @param $data
* @return array
*/
public
static
function
separateLanguages
(
$data
)
{
$cleanedData
=
[];
...
...
@@ -38,6 +43,11 @@ class Helper
return
$cleanedData
;
}
/**
* Create the given model and save its translated attributes
* @param $model
* @param $data
*/
public
static
function
createTranslatedFields
(
$model
,
$data
)
{
$model
=
new
$model
;
...
...
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