Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-adminpanel
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
laravel-adminpanel
Commits
ede46b19
Commit
ede46b19
authored
Feb 01, 2018
by
Vipul Basapati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Solves #144
parent
9f46d982
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
16 deletions
+34
-16
FrontendController.php
app/Http/Controllers/Frontend/FrontendController.php
+7
-7
PageAttribute.php
app/Models/Page/Traits/Attribute/PageAttribute.php
+12
-0
PagesRepository.php
app/Repositories/Backend/Pages/PagesRepository.php
+1
-0
PagesRepository.php
app/Repositories/Frontend/Pages/PagesRepository.php
+7
-7
index.blade.php
resources/views/frontend/pages/index.blade.php
+5
-0
Frontend.php
routes/Frontend/Frontend.php
+2
-2
No files found.
app/Http/Controllers/Frontend/FrontendController.php
View file @
ede46b19
...
...
@@ -2,9 +2,9 @@
namespace
App\Http\Controllers\Frontend
;
use
App\Http\Controllers\Controller
;
use
App\Models\Settings\Setting
;
use
App\Repositories\Frontend\CMSPages\CMSPagesRepository
;
use
App\Http\Controllers\Controller
;
use
App\Repositories\Frontend\Pages\PagesRepository
;
/**
* Class FrontendController.
...
...
@@ -31,13 +31,13 @@ class FrontendController extends Controller
}
/**
* show
cmspage by page
slug.
* show
page by $page_
slug.
*/
public
function
show
CMSPage
(
$page_slug
,
CMSPagesRepository
$RepositoryContract
)
public
function
show
Page
(
$slug
,
PagesRepository
$pages
)
{
$result
=
$
RepositoryContract
->
findBySlug
(
$page_
slug
);
$result
=
$
pages
->
findBySlug
(
$
slug
);
return
view
(
'frontend.
cms
pages.index'
)
->
with
Cmspages
(
$result
);
return
view
(
'frontend.pages.index'
)
->
with
page
(
$result
);
}
}
app/Models/Page/Traits/Attribute/PageAttribute.php
View file @
ede46b19
...
...
@@ -14,10 +14,22 @@ trait PageAttribute
{
return
'<div class="btn-group action-btn">
'
.
$this
->
getEditButtonAttribute
(
'edit-page'
,
'admin.pages.edit'
)
.
'
'
.
$this
->
getViewButtonAttribute
()
.
'
'
.
$this
->
getDeleteButtonAttribute
(
'delete-page'
,
'admin.pages.destroy'
)
.
'
</div>'
;
}
/**
* @return string
*/
public
function
getViewButtonAttribute
()
{
return
'<a target="_blank" href="'
.
route
(
'frontend.pages.show'
,
$this
->
page_slug
)
.
'" class="btn btn-flat btn-default">
<i data-toggle="tooltip" data-placement="top" title="View Page" class="fa fa-eye"></i>
</a>'
;
}
/**
* @return string
*/
...
...
app/Repositories/Backend/Pages/PagesRepository.php
View file @
ede46b19
...
...
@@ -29,6 +29,7 @@ class PagesRepository extends BaseRepository
->
select
([
config
(
'module.pages.table'
)
.
'.id'
,
config
(
'module.pages.table'
)
.
'.title'
,
config
(
'module.pages.table'
)
.
'.page_slug'
,
config
(
'module.pages.table'
)
.
'.status'
,
config
(
'module.pages.table'
)
.
'.created_at'
,
config
(
'module.pages.table'
)
.
'.updated_at'
,
...
...
app/Repositories/Frontend/
CMSPages/CMS
PagesRepository.php
→
app/Repositories/Frontend/
Pages/
PagesRepository.php
100755 → 100644
View file @
ede46b19
<?php
namespace
App\Repositories\Frontend\
CMS
Pages
;
namespace
App\Repositories\Frontend\Pages
;
use
App\Exceptions\GeneralException
;
use
App\Models\
CMSPages\CMS
Page
;
use
App\Models\
Page\
Page
;
use
App\Repositories\BaseRepository
;
/**
* Class
CMS
PagesRepository.
* Class PagesRepository.
*/
class
CMS
PagesRepository
extends
BaseRepository
class
PagesRepository
extends
BaseRepository
{
/**
* Associated Repository Model.
*/
const
MODEL
=
CMS
Page
::
class
;
const
MODEL
=
Page
::
class
;
/*
* Find
cmspage by page
slug
* Find
page by page_
slug
*/
public
function
findBySlug
(
$page_slug
)
{
...
...
@@ -25,6 +25,6 @@ class CMSPagesRepository extends BaseRepository
return
$this
->
query
()
->
wherePage_slug
(
$page_slug
)
->
firstOrFail
();
}
throw
new
GeneralException
(
trans
(
'exceptions.backend.access.
cms
pages.not_found'
));
throw
new
GeneralException
(
trans
(
'exceptions.backend.access.pages.not_found'
));
}
}
resources/views/frontend/
cms
pages/index.blade.php
→
resources/views/frontend/pages/index.blade.php
100755 → 100644
View file @
ede46b19
@
extends
(
'frontend.layouts.app'
)
@
section
(
'content'
)
{
!!
$cmspages
->
description
!!
}
@
section
(
'content'
)
{
!!
$page
->
description
!!
}
@
endsection
\ No newline at end of file
routes/Frontend/Frontend.php
View file @
ede46b19
...
...
@@ -38,6 +38,6 @@ Route::group(['middleware' => 'auth'], function () {
});
/*
* Show
cms
pages
* Show pages
*/
Route
::
get
(
'
cmspage/{page_slug}'
,
'FrontendController@showCMSPage'
)
->
name
(
'cms
pages.show'
);
Route
::
get
(
'
pages/{slug}'
,
'FrontendController@showPage'
)
->
name
(
'
pages.show'
);
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