Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webprofile-jwg2024
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Siti Aisah
webprofile-jwg2024
Commits
f6d6de7d
Commit
f6d6de7d
authored
Jan 14, 2020
by
Aan Choesni Herlingga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add translate controller
parent
38936c52
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
9 deletions
+17
-9
app/Http/Controllers/HomeController.php
+0
-8
app/Http/Controllers/TranslateController.php
+16
-0
routes/web.php
+1
-1
No files found.
app/Http/Controllers/HomeController.php
View file @
f6d6de7d
...
...
@@ -25,12 +25,4 @@ class HomeController extends Controller
{
return
view
(
'home'
);
}
public
function
changeLocale
(
Request
$request
)
{
$language
=
$request
->
language
==
'en'
?
'en'
:
'id'
;
session
([
'selected_language'
=>
$language
]);
return
redirect
()
->
back
();
}
}
app/Http/Controllers/TranslateController.php
0 → 100644
View file @
f6d6de7d
<?php
namespace
App\Http\Controllers
;
use
Illuminate\Http\Request
;
class
TranslateController
extends
Controller
{
public
function
changeLocale
(
Request
$request
)
{
$language
=
$request
->
language
==
'en'
?
'en'
:
'id'
;
session
([
'selected_language'
=>
$language
]);
return
redirect
()
->
back
();
}
}
routes/web.php
View file @
f6d6de7d
...
...
@@ -13,5 +13,5 @@
Auth
::
routes
();
Route
::
post
(
'/change-language'
,
'
Hom
eController@changeLocale'
)
->
name
(
'language'
);
Route
::
post
(
'/change-language'
,
'
Translat
eController@changeLocale'
)
->
name
(
'language'
);
Route
::
get
(
'/home'
,
'HomeController@index'
)
->
name
(
'home'
);
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