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
478ec034
Commit
478ec034
authored
Jan 13, 2020
by
Aan Choesni Herlingga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
front category
parent
8d1ce446
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
3 deletions
+84
-3
app/Http/Controllers/Webprofile/Front/ArchiveController.php
+2
-2
app/Http/Controllers/Webprofile/Front/CategoryController.php
+81
-0
routes/webprofile/front.php
+1
-1
No files found.
app/Http/Controllers/Webprofile/Front/ArchiveController.php
View file @
478ec034
...
@@ -31,7 +31,7 @@ class ArchiveController extends Controller
...
@@ -31,7 +31,7 @@ class ArchiveController extends Controller
public
function
getDataId
(
$setting
)
public
function
getDataId
(
$setting
)
{
{
$setting
=
webprofilesetting
();
$setting
=
webprofilesetting
();
$data
=
$data
=
Posts
::
where
(
'post_status'
,
'1'
)
->
orderBy
(
'post_date'
,
'desc'
)
->
paginate
(
$setting
[
'post_per_page'
]);
$data
=
Posts
::
where
(
'post_status'
,
'1'
)
->
orderBy
(
'post_date'
,
'desc'
)
->
paginate
(
$setting
[
'post_per_page'
]);
$resend
=
Posts
::
where
(
'post_status'
,
'1'
)
->
orderby
(
'post_date'
,
'desc'
)
->
limit
(
'5'
)
->
get
();
$resend
=
Posts
::
where
(
'post_status'
,
'1'
)
->
orderby
(
'post_date'
,
'desc'
)
->
limit
(
'5'
)
->
get
();
$hot
=
Posts
::
where
(
'post_status'
,
'1'
)
->
orderby
(
'viewer'
,
'desc'
)
->
limit
(
'5'
)
->
get
();
$hot
=
Posts
::
where
(
'post_status'
,
'1'
)
->
orderby
(
'viewer'
,
'desc'
)
->
limit
(
'5'
)
->
get
();
$categories
=
Categories
::
where
(
'is_active'
,
'1'
)
->
get
();
$categories
=
Categories
::
where
(
'is_active'
,
'1'
)
->
get
();
...
@@ -55,7 +55,7 @@ class ArchiveController extends Controller
...
@@ -55,7 +55,7 @@ class ArchiveController extends Controller
public
function
getDataEn
(
$setting
)
public
function
getDataEn
(
$setting
)
{
{
$setting
=
webprofilesetting
();
$setting
=
webprofilesetting
();
$data
=
$data
=
Posts
::
where
(
'post_status'
,
'1'
)
->
orderBy
(
'post_date'
,
'desc'
)
->
paginate
(
$setting
[
'post_per_page'
]);
$data
=
Posts
::
where
(
'post_status'
,
'1'
)
->
orderBy
(
'post_date'
,
'desc'
)
->
paginate
(
$setting
[
'post_per_page'
]);
$resend
=
Posts
::
with
([
'rEn'
])
->
where
(
'post_status'
,
'1'
)
->
orderby
(
'post_date'
,
'desc'
)
->
limit
(
'5'
)
->
get
();
$resend
=
Posts
::
with
([
'rEn'
])
->
where
(
'post_status'
,
'1'
)
->
orderby
(
'post_date'
,
'desc'
)
->
limit
(
'5'
)
->
get
();
$hot
=
Posts
::
with
([
'rEn'
])
->
where
(
'post_status'
,
'1'
)
->
orderby
(
'viewer'
,
'desc'
)
->
limit
(
'5'
)
->
get
();
$hot
=
Posts
::
with
([
'rEn'
])
->
where
(
'post_status'
,
'1'
)
->
orderby
(
'viewer'
,
'desc'
)
->
limit
(
'5'
)
->
get
();
$categories
=
Categories
::
with
([
'rEn'
])
->
where
(
'is_active'
,
'1'
)
->
get
();
$categories
=
Categories
::
with
([
'rEn'
])
->
where
(
'is_active'
,
'1'
)
->
get
();
...
...
app/Http/Controllers/Webprofile/Front/CategoryController.php
0 → 100644
View file @
478ec034
<?php
namespace
App\Http\Controllers\Webprofile\Front
;
use
App\Http\Controllers\Controller
;
use
App\Models\Webprofile\Categories
;
use
App\Models\Webprofile\Design
;
use
App\Models\Webprofile\Posts
;
use
App\Models\Webprofile\Menu
;
use
Session
;
class
CategoryController
extends
Controller
{
public
function
index
(
$category
)
{
$setting
=
webprofilesetting
();
if
(
!
Session
::
has
(
'selected_language'
))
{
session
([
'selected_language'
=>
'id'
]);
}
if
(
Session
::
get
(
'selected_language'
)
==
'id'
)
{
$data
=
$this
->
getDataId
(
$setting
,
$category
);
return
view
(
'webprofile.front.'
.
$setting
[
'theme'
]
.
'.archive'
,
$data
)
->
withTitle
(
'Arsip'
);
}
else
if
(
Session
::
get
(
'selected_language'
)
==
'en'
)
{
$data
=
$this
->
getDataEn
(
$setting
,
$category
);
return
view
(
'webprofile.front.'
.
$setting
[
'theme'
]
.
'.en.archive'
,
$data
)
->
withTitle
(
'Archive'
);
}
}
public
function
getDataId
(
$setting
,
$category
)
{
$setting
=
webprofilesetting
();
$findCategory
=
Categories
::
where
(
'name'
,
$category
)
->
first
();
$data
=
Posts
::
where
(
'categories'
,
$findCategory
->
id
)
->
where
(
'post_status'
,
'1'
)
->
orderBy
(
'post_date'
,
'desc'
)
->
paginate
(
$setting
[
'post_per_page'
]);
$resend
=
Posts
::
where
(
'post_status'
,
'1'
)
->
orderby
(
'post_date'
,
'desc'
)
->
limit
(
'5'
)
->
get
();
$hot
=
Posts
::
where
(
'post_status'
,
'1'
)
->
orderby
(
'viewer'
,
'desc'
)
->
limit
(
'5'
)
->
get
();
$categories
=
Categories
::
where
(
'is_active'
,
'1'
)
->
get
();
$menu
=
Menu
::
orderby
(
'urutan'
,
'asc'
)
->
get
();
$widget_right
=
Design
::
where
(
'name_design'
,
'widget_right'
)
->
orderBy
(
'urutan'
,
'ASC'
)
->
get
();
$widget_left
=
Design
::
where
(
'name_design'
,
'widget_left'
)
->
orderBy
(
'urutan'
,
'ASC'
)
->
get
();
$data
=
[
'setting'
=>
$setting
,
'data'
=>
$data
,
'menu'
=>
$menu
,
'widget_right'
=>
$widget_right
,
'widget_left'
=>
$widget_left
,
'resend'
=>
$resend
,
'hot'
=>
$hot
,
'categories'
=>
$categories
,
];
return
$data
;
}
public
function
getDataEn
(
$setting
,
$category
)
{
$setting
=
webprofilesetting
();
$findCategory
=
Categories
::
where
(
'name'
,
$category
)
->
first
();
$data
=
Posts
::
with
([
'rEn'
])
->
where
(
'categories'
,
$findCategory
->
id
)
->
where
(
'post_status'
,
'1'
)
->
orderBy
(
'post_date'
,
'desc'
)
->
paginate
(
$setting
[
'post_per_page'
]);
$resend
=
Posts
::
with
([
'rEn'
])
->
where
(
'post_status'
,
'1'
)
->
orderby
(
'post_date'
,
'desc'
)
->
limit
(
'5'
)
->
get
();
$hot
=
Posts
::
with
([
'rEn'
])
->
where
(
'post_status'
,
'1'
)
->
orderby
(
'viewer'
,
'desc'
)
->
limit
(
'5'
)
->
get
();
$categories
=
Categories
::
with
([
'rEn'
])
->
where
(
'is_active'
,
'1'
)
->
get
();
$menu
=
Menu
::
with
([
'rEn'
])
->
orderby
(
'urutan'
,
'asc'
)
->
get
();
$widget_right
=
Design
::
where
(
'name_design'
,
'widget_right'
)
->
orderBy
(
'urutan'
,
'ASC'
)
->
get
();
$widget_left
=
Design
::
where
(
'name_design'
,
'widget_left'
)
->
orderBy
(
'urutan'
,
'ASC'
)
->
get
();
$data
=
[
'setting'
=>
$setting
,
'data'
=>
$data
,
'menu'
=>
$menu
,
'widget_right'
=>
$widget_right
,
'widget_left'
=>
$widget_left
,
'resend'
=>
$resend
,
'hot'
=>
$hot
,
'categories'
=>
$categories
,
];
return
$data
;
}
}
routes/webprofile/front.php
View file @
478ec034
...
@@ -4,7 +4,7 @@ Route::group(['namespace' => 'Webprofile\Front'], function () {
...
@@ -4,7 +4,7 @@ Route::group(['namespace' => 'Webprofile\Front'], function () {
Route
::
get
(
'page/{id}'
,
'PageController@index'
)
->
name
(
'page'
);
Route
::
get
(
'page/{id}'
,
'PageController@index'
)
->
name
(
'page'
);
Route
::
get
(
'post/{id}'
,
'PostController@index'
)
->
name
(
'post'
);
Route
::
get
(
'post/{id}'
,
'PostController@index'
)
->
name
(
'post'
);
Route
::
get
(
'archive'
,
'ArchiveController@index'
)
->
name
(
'archive'
);
Route
::
get
(
'archive'
,
'ArchiveController@index'
)
->
name
(
'archive'
);
Route
::
get
(
'category/{id}'
,
'
FrontController@category
'
)
->
name
(
'category'
);
Route
::
get
(
'category/{id}'
,
'
CategoryController@index
'
)
->
name
(
'category'
);
Route
::
get
(
'info/{id}'
,
'FrontController@info'
)
->
name
(
'infomation'
);
Route
::
get
(
'info/{id}'
,
'FrontController@info'
)
->
name
(
'infomation'
);
Route
::
get
(
'agenda'
,
'FrontController@agenda'
)
->
name
(
'agenda'
);
Route
::
get
(
'agenda'
,
'FrontController@agenda'
)
->
name
(
'agenda'
);
Route
::
get
(
'error'
,
'FrontController@error'
)
->
name
(
'error'
);
Route
::
get
(
'error'
,
'FrontController@error'
)
->
name
(
'error'
);
...
...
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