Unverified Commit 70f72da8 authored by Viral Solani's avatar Viral Solani Committed by GitHub

Merge pull request #38 from bvipul/vs_cmpages_to_pages

Changed CmsPages To Pages Module
parents 0976330d bb0b8d37
<?php
namespace App\Events\Backend\CMSPages;
namespace App\Events\Backend\Pages;
use Illuminate\Queue\SerializesModels;
/**
* Class CMSPageCreated.
* Class PageCreated.
*/
class CMSPageCreated
class PageCreated
{
use SerializesModels;
/**
* @var
*/
public $cmspages;
public $page;
/**
* @param $cmspages
* @param $page
*/
public function __construct($cmspages)
public function __construct($page)
{
$this->cmspages = $cmspages;
$this->page = $page;
}
}
<?php
namespace App\Events\Backend\CMSPages;
namespace App\Events\Backend\Pages;
use Illuminate\Queue\SerializesModels;
/**
* Class CMSPageDeleted.
* Class PageDeleted.
*/
class CMSPageDeleted
class PageDeleted
{
use SerializesModels;
/**
* @var
*/
public $cmspages;
public $page;
/**
* @param $cmspages
* @param $page
*/
public function __construct($cmspages)
public function __construct($page)
{
$this->cmspages = $cmspages;
$this->page = $page;
}
}
<?php
namespace App\Events\Backend\CMSPages;
namespace App\Events\Backend\Pages;
use Illuminate\Queue\SerializesModels;
/**
* Class CMSPageUpdated.
* Class PageUpdated.
*/
class CMSPageUpdated
class PageUpdated
{
use SerializesModels;
/**
* @var
*/
public $cmspages;
public $page;
/**
* @param $cmspages
* @param $page
*/
public function __construct($cmspages)
public function __construct($page)
{
$this->cmspages = $cmspages;
$this->page = $page;
}
}
<?php
namespace App\Http\Controllers\Backend\CMSPages;
use App\Http\Controllers\Controller;
use App\Http\Requests\Backend\CMSPages\CreateCMSPagesRequest;
use App\Http\Requests\Backend\CMSPages\DeleteCMSPagesRequest;
use App\Http\Requests\Backend\CMSPages\EditCMSPagesRequest;
use App\Http\Requests\Backend\CMSPages\ManageCMSPagesRequest;
use App\Http\Requests\Backend\CMSPages\StoreCMSPagesRequest;
use App\Http\Requests\Backend\CMSPages\UpdateCMSPagesRequest;
use App\Models\CMSPages\CMSPage;
use App\Repositories\Backend\CMSPages\CMSPagesRepository;
/**
* Class CMSPagesController.
*/
class CMSPagesController extends Controller
{
/**
* @var CMSPagesRepository
*/
protected $cmspages;
/**
* @param CMSPagesRepository $cmspages
*/
public function __construct(CMSPagesRepository $cmspages)
{
$this->cmspages = $cmspages;
}
/**
* @param ManageCMSPagesRequest $request
*
* @return mixed
*/
public function index(ManageCMSPagesRequest $request)
{
return view('backend.cmspages.index');
}
/**
* @param CreateCMSPagesRequest $request
*
* @return mixed
*/
public function create(CreateCMSPagesRequest $request)
{
return view('backend.cmspages.create');
}
/**
* @param StoreCMSPagesRequest $request
*
* @return mixed
*/
public function store(StoreCMSPagesRequest $request)
{
$this->cmspages->create($request->all());
return redirect()->route('admin.cmspages.index')->withFlashSuccess(trans('alerts.backend.cmspages.created'));
}
/**
* @param CMSPage $cmspage
* @param EditCMSPagesRequest $request
*
* @return mixed
*/
public function edit(CMSPage $cmspage, EditCMSPagesRequest $request)
{
return view('backend.cmspages.edit')
->withCmspage($cmspage);
}
/**
* @param CMSPage $cmspage
* @param EditCMSPagesRequest $request
*
* @return mixed
*/
public function update(CMSPage $cmspage, UpdateCMSPagesRequest $request)
{
$this->cmspages->update($cmspage, $request->all());
return redirect()->route('admin.cmspages.index')->withFlashSuccess(trans('alerts.backend.cmspages.updated'));
}
/**
* @param Permission $permission
* @param DeleteCMSPagesRequest $request
*
* @return mixed
*/
public function destroy(CMSPage $cmspage, DeleteCMSPagesRequest $request)
{
$this->cmspages->delete($cmspage);
return redirect()->route('admin.cmspages.index')->withFlashSuccess(trans('alerts.backend.cmspages.deleted'));
}
}
<?php
namespace App\Http\Controllers\Backend\Pages;
use App\Models\Page\Page;
use App\Http\Controllers\Controller;
use App\Repositories\Backend\Pages\PagesRepository;
use App\Http\Requests\Backend\Pages\EditPageRequest;
use App\Http\Requests\Backend\Pages\StorePageRequest;
use App\Http\Requests\Backend\Pages\CreatePageRequest;
use App\Http\Requests\Backend\Pages\DeletePageRequest;
use App\Http\Requests\Backend\Pages\ManagePageRequest;
use App\Http\Requests\Backend\Pages\UpdatePageRequest;
/**
* Class PagesController.
*/
class PagesController extends Controller
{
/**
* @var PagesRepository
*/
protected $pages;
/**
* @param PagesRepository $pages
*/
public function __construct(PagesRepository $pages)
{
$this->pages = $pages;
}
/**
* @param ManagePageRequest $request
*
* @return mixed
*/
public function index(ManagePageRequest $request)
{
return view('backend.pages.index');
}
/**
* @param CreatePageRequest $request
*
* @return mixed
*/
public function create(CreatePageRequest $request)
{
return view('backend.pages.create');
}
/**
* @param StorePageRequest $request
*
* @return mixed
*/
public function store(StorePageRequest $request)
{
$this->pages->create($request->all());
return redirect()->route('admin.pages.index')->withFlashSuccess(trans('alerts.backend.pages.created'));
}
/**
* @param Page $page
* @param EditPageRequest $request
*
* @return mixed
*/
public function edit(Page $page, EditPageRequest $request)
{
return view('backend.pages.edit')
->withCmspage($page);
}
/**
* @param Page $page
* @param UpdatePageRequest $request
*
* @return mixed
*/
public function update(Page $page, UpdatePageRequest $request)
{
$this->pages->update($page, $request->all());
return redirect()->route('admin.pages.index')->withFlashSuccess(trans('alerts.backend.pages.updated'));
}
/**
* @param Page $page
* @param DeletePageRequest $request
*
* @return mixed
*/
public function destroy(Page $page, DeletePageRequest $request)
{
$this->pages->delete($page);
return redirect()->route('admin.pages.index')->withFlashSuccess(trans('alerts.backend.pages.deleted'));
}
}
<?php
namespace App\Http\Controllers\Backend\CMSPages;
namespace App\Http\Controllers\Backend\Pages;
use App\Http\Controllers\Controller;
use App\Http\Requests\Backend\CMSPages\ManageCMSPagesRequest;
use App\Repositories\Backend\CMSPages\CMSPagesRepository;
use Carbon\Carbon;
use App\Http\Controllers\Controller;
use Yajra\DataTables\Facades\DataTables;
use App\Repositories\Backend\Pages\PagesRepository;
use App\Http\Requests\Backend\Pages\ManagePageRequest;
/**
* Class CMSPagesTableController.
* Class PagesTableController.
*/
class CMSPagesTableController extends Controller
class PagesTableController extends Controller
{
/**
* @var CMSPagesRepository
* @var PagesRepository
*/
protected $cmspages;
protected $pages;
/**
* @param CMSPagesRepository $cmspages
* @param PagesRepository $pages
*/
public function __construct(CMSPagesRepository $cmspages)
public function __construct(PagesRepository $pages)
{
$this->cmspages = $cmspages;
$this->pages = $pages;
}
/**
* @param ManageCMSPagesRequest $request
* @param ManagePageRequest $request
*
* @return mixed
*/
public function __invoke(ManageCMSPagesRequest $request)
public function __invoke(ManagePageRequest $request)
{
return Datatables::of($this->cmspages->getForDataTable())
return Datatables::of($this->pages->getForDataTable())
->escapeColumns(['title'])
->addColumn('status', function ($cmspages) {
if ($cmspages->status) {
->addColumn('status', function ($pages) {
if ($pages->status) {
return '<span class="label label-success">Active</span>';
}
return '<span class="label label-danger">Inactive</span>';
})
->addColumn('created_at', function ($cmspages) {
return Carbon::parse($cmspages->created_at)->toDateString();
->addColumn('created_at', function ($pages) {
return Carbon::parse($pages->created_at)->toDateString();
})
->addColumn('updated_at', function ($cmspages) {
return Carbon::parse($cmspages->updated_at)->toDateString();
->addColumn('updated_at', function ($pages) {
return Carbon::parse($pages->updated_at)->toDateString();
})
->addColumn('actions', function ($cmspages) {
return $cmspages->action_buttons;
->addColumn('actions', function ($pages) {
return $pages->action_buttons;
})
->make(true);
}
......
<?php
namespace App\Http\Requests\Backend\CMSPages;
namespace App\Http\Requests\Backend\Pages;
use App\Http\Requests\Request;
/**
* Class EditCMSPagesRequest.
* Class CreatePageRequest.
*/
class EditCMSPagesRequest extends Request
class CreatePageRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
......@@ -16,7 +16,7 @@ class EditCMSPagesRequest extends Request
*/
public function authorize()
{
return access()->allow('edit-cms-pages');
return access()->allow('create-page');
}
/**
......
<?php
namespace App\Http\Requests\Backend\CMSPages;
namespace App\Http\Requests\Backend\Pages;
use App\Http\Requests\Request;
/**
* Class ManageCMSPagesRequest.
* Class DeletePageRequest.
*/
class ManageCMSPagesRequest extends Request
class DeletePageRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
......@@ -16,7 +16,7 @@ class ManageCMSPagesRequest extends Request
*/
public function authorize()
{
return access()->allow('view-cms-pages');
return access()->allow('delete-page');
}
/**
......
<?php
namespace App\Http\Requests\Backend\CMSPages;
namespace App\Http\Requests\Backend\Pages;
use App\Http\Requests\Request;
/**
* Class DeleteCMSPagesRequest.
* Class EditPageRequest.
*/
class DeleteCMSPagesRequest extends Request
class EditPageRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
......@@ -16,7 +16,7 @@ class DeleteCMSPagesRequest extends Request
*/
public function authorize()
{
return access()->allow('delete-cms-pages');
return access()->allow('edit-page');
}
/**
......
<?php
namespace App\Http\Requests\Backend\CMSPages;
namespace App\Http\Requests\Backend\Pages;
use App\Http\Requests\Request;
/**
* Class CreateCMSPagesRequest.
* Class ManagePageRequest.
*/
class CreateCMSPagesRequest extends Request
class ManagePageRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
......@@ -16,7 +16,7 @@ class CreateCMSPagesRequest extends Request
*/
public function authorize()
{
return access()->allow('create-cms-pages');
return access()->allow('view-page');
}
/**
......
<?php
namespace App\Http\Requests\Backend\CMSPages;
namespace App\Http\Requests\Backend\Pages;
use App\Http\Requests\Request;
/**
* Class StoreCMSPagesRequest.
* Class StorePageRequest.
*/
class StoreCMSPagesRequest extends Request
class StorePageRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
......@@ -16,7 +16,7 @@ class StoreCMSPagesRequest extends Request
*/
public function authorize()
{
return access()->allow('create-cms-pages');
return access()->allow('create-page');
}
/**
......
<?php
namespace App\Http\Requests\Backend\CMSPages;
namespace App\Http\Requests\Backend\Pages;
use App\Http\Requests\Request;
/**
* Class UpdateCMSPagesRequest.
* Class UpdatePageRequest.
*/
class UpdateCMSPagesRequest extends Request
class UpdatePageRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
......@@ -16,7 +16,7 @@ class UpdateCMSPagesRequest extends Request
*/
public function authorize()
{
return access()->allow('edit-cms-pages');
return access()->allow('edit-page');
}
/**
......
<?php
namespace App\Models\CMSPages;
namespace App\Models\Page;
use App\Models\CMSPages\Traits\Attribute\CMSPageAttribute;
use App\Models\ModelTrait;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Models\Page\Traits\Attribute\PageAttribute;
class CMSPage extends Model
class Page extends Model
{
use ModelTrait,
SoftDeletes,
CMSPageAttribute {
// CMSPageAttribute::getEditButtonAttribute insteadof ModelTrait;
PageAttribute {
// PageAttribute::getEditButtonAttribute insteadof ModelTrait;
}
/**
......
<?php
namespace App\Models\CMSPages\Traits\Attribute;
namespace App\Models\Page\Traits\Attribute;
/**
* Class CMSPageAttribute.
* Class PageAttribute.
*/
trait CMSPageAttribute
trait PageAttribute
{
/**
* @return string
......@@ -13,8 +13,8 @@ trait CMSPageAttribute
public function getActionButtonsAttribute()
{
return '<div class="btn-group action-btn">
'.$this->getEditButtonAttribute('edit-cms-pages', 'admin.cmspages.edit').'
'.$this->getDeleteButtonAttribute('delete-cms-pages', 'admin.cmspages.destroy').'
'.$this->getEditButtonAttribute('edit-cms-pages', 'admin.pages.edit').'
'.$this->getDeleteButtonAttribute('delete-cms-pages', 'admin.pages.destroy').'
</div>';
}
}
<?php
namespace App\Repositories\Backend\CMSPages;
namespace App\Repositories\Backend\Pages;
use App\Events\Backend\CMSPages\CMSPageCreated;
use App\Events\Backend\CMSPages\CMSPageDeleted;
use App\Events\Backend\CMSPages\CMSPageUpdated;
use App\Exceptions\GeneralException;
use App\Models\CMSPages\CMSPage;
use App\Repositories\BaseRepository;
use DB;
use App\Models\Page\Page;
use App\Repositories\BaseRepository;
use App\Exceptions\GeneralException;
use Illuminate\Database\Eloquent\Model;
use App\Events\Backend\Pages\PageCreated;
use App\Events\Backend\Pages\PageDeleted;
use App\Events\Backend\Pages\PageUpdated;
/**
* Class CMSPagesRepository.
* Class PagesRepository.
*/
class CMSPagesRepository extends BaseRepository
class PagesRepository extends BaseRepository
{
/**
* Associated Repository Model.
*/
const MODEL = CMSPage::class;
const MODEL = Page::class;
/**
* @return mixed
......@@ -28,11 +28,11 @@ class CMSPagesRepository extends BaseRepository
{
return $this->query()
->select([
config('access.cms_pages_table').'.id',
config('access.cms_pages_table').'.title',
config('access.cms_pages_table').'.status',
config('access.cms_pages_table').'.created_at',
config('access.cms_pages_table').'.updated_at',
config('access.pages_table').'.id',
config('access.pages_table').'.title',
config('access.pages_table').'.status',
config('access.pages_table').'.created_at',
config('access.pages_table').'.updated_at',
]);
}
......@@ -46,29 +46,29 @@ class CMSPagesRepository extends BaseRepository
public function create(array $input)
{
if ($this->query()->where('title', $input['title'])->first()) {
throw new GeneralException(trans('exceptions.backend.cmspages.already_exists'));
throw new GeneralException(trans('exceptions.backend.pages.already_exists'));
}
DB::transaction(function () use ($input) {
$cmspages = self::MODEL;
$cmspages = new $cmspages();
$cmspages->title = $input['title'];
$cmspages->page_slug = str_slug($input['title']);
$cmspages->description = $input['description'];
$cmspages->cannonical_link = $input['cannonical_link'];
$cmspages->seo_title = $input['seo_title'];
$cmspages->seo_keyword = $input['seo_keyword'];
$cmspages->seo_description = $input['seo_description'];
$cmspages->status = (isset($input['status']) && $input['status'] == 1) ? 1 : 0;
$cmspages->created_by = access()->user()->id;
if ($cmspages->save()) {
event(new CMSPageCreated($cmspages));
$pages = self::MODEL;
$pages = new $pages();
$pages->title = $input['title'];
$pages->page_slug = str_slug($input['title']);
$pages->description = $input['description'];
$pages->cannonical_link = $input['cannonical_link'];
$pages->seo_title = $input['seo_title'];
$pages->seo_keyword = $input['seo_keyword'];
$pages->seo_description = $input['seo_description'];
$pages->status = (isset($input['status']) && $input['status'] == 1) ? 1 : 0;
$pages->created_by = access()->user()->id;
if ($pages->save()) {
event(new PageCreated($pages));
return true;
}
throw new GeneralException(trans('exceptions.backend.cmspages.create_error'));
throw new GeneralException(trans('exceptions.backend.pages.create_error'));
});
}
......@@ -80,49 +80,49 @@ class CMSPagesRepository extends BaseRepository
*
* return bool
*/
public function update(Model $cmspages, array $input)
public function update(Model $page, array $input)
{
if ($this->query()->where('title', $input['title'])->where('id', '!=', $cmspages->id)->first()) {
throw new GeneralException(trans('exceptions.backend.cmspages.already_exists'));
if ($this->query()->where('title', $input['title'])->where('id', '!=', $page->id)->first()) {
throw new GeneralException(trans('exceptions.backend.pages.already_exists'));
}
$cmspages->title = $input['title'];
$cmspages->page_slug = str_slug($input['title']);
$cmspages->description = $input['description'];
$cmspages->cannonical_link = $input['cannonical_link'];
$cmspages->seo_title = $input['seo_title'];
$cmspages->seo_keyword = $input['seo_keyword'];
$cmspages->seo_description = $input['seo_description'];
$cmspages->status = (isset($input['status']) && $input['status'] == 1) ? 1 : 0;
$cmspages->updated_by = access()->user()->id;
DB::transaction(function () use ($cmspages, $input) {
if ($cmspages->save()) {
event(new CMSPageUpdated($cmspages));
$page->title = $input['title'];
$page->page_slug = str_slug($input['title']);
$page->description = $input['description'];
$page->cannonical_link = $input['cannonical_link'];
$page->seo_title = $input['seo_title'];
$page->seo_keyword = $input['seo_keyword'];
$page->seo_description = $input['seo_description'];
$page->status = (isset($input['status']) && $input['status'] == 1) ? 1 : 0;
$page->updated_by = access()->user()->id;
DB::transaction(function () use ($page, $input) {
if ($page->save()) {
event(new PageUpdated($page));
return true;
}
throw new GeneralException(trans('exceptions.backend.cmspages.update_error'));
throw new GeneralException(trans('exceptions.backend.pages.update_error'));
});
}
/**
* @param Model $cmspage
* @param Model $page
*
* @throws GeneralException
*
* @return bool
*/
public function delete(Model $cmspage)
public function delete(Model $page)
{
DB::transaction(function () use ($cmspage) {
if ($cmspage->delete()) {
event(new CMSPageDeleted($cmspage));
DB::transaction(function () use ($page) {
if ($page->delete()) {
event(new PageDeleted($page));
return true;
}
throw new GeneralException(trans('exceptions.backend.cmspages.delete_error'));
throw new GeneralException(trans('exceptions.backend.pages.delete_error'));
});
}
}
......@@ -63,7 +63,7 @@ return [
/*
* cmspages table used to store cmspages
*/
'cms_pages_table' => 'cms_pages',
'pages_table' => 'pages',
/*
* email template placeholders table used to store email template placeholders
......
......@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateCmsPagesTable extends Migration
class CreatePagesTable extends Migration
{
/**
* Run the migrations.
......@@ -12,7 +12,7 @@ class CreateCmsPagesTable extends Migration
*/
public function up()
{
Schema::create('cms_pages', function (Blueprint $table) {
Schema::create('pages', function (Blueprint $table) {
$table->increments('id');
$table->string('title', 191);
$table->string('page_slug', 191)->unique();
......@@ -36,6 +36,6 @@ class CreateCmsPagesTable extends Migration
*/
public function down()
{
Schema::drop('cms_pages');
Schema::drop('pages');
}
}
......@@ -319,12 +319,12 @@ class PermissionTableSeeder extends Seeder
$viewBackend->save();
/**
* CMS Pages.
* Pages.
*/
$permission_model = config('access.permission');
$viewBackend = new $permission_model();
$viewBackend->name = 'view-cms-pages';
$viewBackend->display_name = 'View CMS Pages';
$viewBackend->name = 'view-page';
$viewBackend->display_name = 'View Page';
$viewBackend->sort = 23;
$viewBackend->created_by = 1;
$viewBackend->updated_by = null;
......@@ -335,8 +335,8 @@ class PermissionTableSeeder extends Seeder
$permission_model = config('access.permission');
$viewBackend = new $permission_model();
$viewBackend->name = 'create-cms-pages';
$viewBackend->display_name = 'Create CMS Pages';
$viewBackend->name = 'create-page';
$viewBackend->display_name = 'Create Page';
$viewBackend->sort = 24;
$viewBackend->created_by = 1;
$viewBackend->updated_by = null;
......@@ -347,8 +347,8 @@ class PermissionTableSeeder extends Seeder
$permission_model = config('access.permission');
$viewBackend = new $permission_model();
$viewBackend->name = 'edit-cms-pages';
$viewBackend->display_name = 'Edit CMS Pages';
$viewBackend->name = 'edit-page';
$viewBackend->display_name = 'Edit Page';
$viewBackend->sort = 25;
$viewBackend->created_by = 1;
$viewBackend->updated_by = null;
......@@ -359,8 +359,8 @@ class PermissionTableSeeder extends Seeder
$permission_model = config('access.permission');
$viewBackend = new $permission_model();
$viewBackend->name = 'delete-cms-pages';
$viewBackend->display_name = 'Delete CMS Pages';
$viewBackend->name = 'delete-page';
$viewBackend->display_name = 'Delete Page';
$viewBackend->sort = 26;
$viewBackend->created_by = 1;
$viewBackend->updated_by = null;
......
......@@ -25,7 +25,7 @@ class DatabaseSeeder extends Seeder
$this->call(SettingsTableSeeder::class);
$this->call(CountryTableSeeder::class);
$this->call(StateTableSeeder::class);
$this->call(CmsPagesTableSeeder::class);
$this->call(PagesTableSeeder::class);
Model::reguard();
}
......
<?php
use Carbon\Carbon as Carbon;
use Database\DisableForeignKeys;
use Carbon\Carbon;
use Database\TruncateTable;
use Illuminate\Database\Seeder;
use Database\DisableForeignKeys;
use Illuminate\Support\Facades\DB;
class CmsPagesTableSeeder extends Seeder
class PagesTableSeeder extends Seeder
{
use DisableForeignKeys, TruncateTable;
......@@ -18,9 +18,9 @@ class CmsPagesTableSeeder extends Seeder
public function run()
{
$this->disableForeignKeys();
$this->truncate(config('access.cms_pages_table'));
$this->truncate(config('access.pages_table'));
$cmspage = [
$page = [
[
'title' => 'Terms and conditions',
'page_slug' => 'terms-and-conditions',
......@@ -32,7 +32,7 @@ class CmsPagesTableSeeder extends Seeder
],
];
DB::table(config('access.cms_pages_table'))->insert($cmspage);
DB::table(config('access.pages_table'))->insert($page);
$this->enableForeignKeys();
}
......
This diff is collapsed.
......@@ -2,10 +2,10 @@ var FinBuilders = {
/**
* Cmspage
* Pages
*
*/
Cmspage:
Pages:
{
init: function()
{
......
{
"/js/frontend.js": "/js/frontend.d3a9d9963b6da237bfe8.js",
"/js/backend.js": "/js/backend.51a14fd841ccd198e500.js",
"/js/frontend.js": "/js/frontend.6600a6eb362abae28819.js",
"/js/backend.js": "/js/backend.d106d5f7e2110ee3cea7.js",
"/mix.js": "/mix.247ab120fe7680658924.js",
"/css/frontend.css": "/css/frontend.3af0a6cbd7d1d8d042f2a37e97008b7c.css",
"/css/backend.css": "/css/backend.f8550f50504e5b8ef6055285205f223a.css",
"/css/backend-custom.css": "/css/backend-custom.50f14193ab908e3cf471dea6cb6616ae.css",
"/js/backend-custom.js": "/js/backend-custom.d305fff90b4defcf757b268abb9a683c.js",
"/js/dataTable.js": "/js/dataTable.f968d300a6a0b871f138f114361259c8.js"
"/css/frontend.css": "/css/frontend.90a13bfbf8d4ea6a30a8eb218e8d48b3.css",
"/css/backend.css": "/css/backend.7b6d826816293ff35f4185341567f559.css",
"/css/backend-custom.css": "/css/backend-custom.187b92dacd8c501e4a19407d700d279b.css",
"/js/backend-custom.js": "/js/backend-custom.bf0db4a7e7235e1c318af2c5dca556bd.js",
"/js/dataTable.js": "/js/dataTable.0db0f52a09a62d485aa1229ed981b1cf.js"
}
\ No newline at end of file
......@@ -37,10 +37,10 @@ return [
'updated_password' => "The user's password was successfully updated.",
],
'cmspages' => [
'created' => 'The CMS Page was successfully created.',
'deleted' => 'The CMS Page was successfully deleted.',
'updated' => 'The CMS Page was successfully updated.',
'pages' => [
'created' => 'The Page was successfully created.',
'deleted' => 'The Page was successfully deleted.',
'updated' => 'The Page was successfully updated.',
],
'blogcategories' => [
......
......@@ -56,12 +56,12 @@ return [
'update_password_error' => 'There was a problem changing this users password. Please try again.',
],
],
'cmspages' => [
'already_exists' => 'That CMS Page already exists. Please choose a different name.',
'create_error' => 'There was a problem creating this CMS Page. Please try again.',
'delete_error' => 'There was a problem deleting this CMS Page. Please try again.',
'not_found' => 'That CMS Page does not exist.',
'update_error' => 'There was a problem updating this CMS Page. Please try again.',
'pages' => [
'already_exists' => 'That Page already exists. Please choose a different name.',
'create_error' => 'There was a problem creating this Page. Please try again.',
'delete_error' => 'There was a problem deleting this Page. Please try again.',
'not_found' => 'That Page does not exist.',
'update_error' => 'There was a problem updating this Page. Please try again.',
],
'blogcategories' => [
......
......@@ -28,7 +28,7 @@ return [
'deleted' => 'deleted permission',
'updated' => 'updated permission',
],
'cmspages' => [
'pages' => [
'created' => 'created CMS Page',
'deleted' => 'deleted CMS Page',
'updated' => 'updated CMS Page',
......
......@@ -115,11 +115,11 @@ return [
],
],
'cmspages' => [
'create' => 'Create CMS Page',
'edit' => 'Edit CMS Page',
'management' => 'CMS Page Management',
'title' => 'CMS Pages',
'pages' => [
'create' => 'Create Page',
'edit' => 'Edit Page',
'management' => 'Page Management',
'title' => 'Pages',
'table' => [
'title' => 'Title',
......
......@@ -57,12 +57,12 @@ return [
'system' => 'System',
],
'cmspages' => [
'all' => 'All CMS Page',
'create' => 'Create CMS Page',
'edit' => 'Edit CMS Page',
'management' => 'CMS Page Management',
'main' => 'CMS Pages',
'pages' => [
'all' => 'All Pages',
'create' => 'Create Page',
'edit' => 'Edit Page',
'management' => 'Page Management',
'main' => 'Pages',
],
'blogs' => [
......
......@@ -155,7 +155,7 @@ return [
'send_confirmation_email' => 'Send Confirmation E-mail',
],
],
'cmspages' => [
'pages' => [
'title' => 'Title',
'description' => 'Description',
'cannonical_link' => 'Cannonical Link',
......
<!--Action Button-->
@if(Active::checkUriPattern('admin/cmspages'))
@if(Active::checkUriPattern('admin/pages'))
<div class="btn-group">
<button type="button" class="btn btn-warning btn-flat dropdown-toggle" data-toggle="dropdown">Export
<span class="caret"></span>
......@@ -21,9 +21,9 @@
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="{{route('admin.cmspages.index')}}"><i class="fa fa-list-ul"></i> {{trans('menus.backend.cmspages.all')}}</a></li>
@permission('create-cms-pages')
<li><a href="{{route('admin.cmspages.create')}}"><i class="fa fa-plus"></i> {{trans('menus.backend.cmspages.create')}}</a></li>
<li><a href="{{route('admin.pages.index')}}"><i class="fa fa-list-ul"></i> {{trans('menus.backend.pages.all')}}</a></li>
@permission('create-page')
<li><a href="{{route('admin.pages.create')}}"><i class="fa fa-plus"></i> {{trans('menus.backend.pages.create')}}</a></li>
@endauth
</ul>
</div>
......
......@@ -50,11 +50,11 @@
</ul>
</li>
@endauth
@permission('view-cms-pages')
<li class="{{ active_class(Active::checkUriPattern('admin/cmspages*')) }}">
<a href="{{ route('admin.cmspages.index') }}">
@permission('view-page')
<li class="{{ active_class(Active::checkUriPattern('admin/pages*')) }}">
<a href="{{ route('admin.pages.index') }}">
<i class="fa fa-file-text"></i>
<span>{{ trans('labels.backend.cmspages.title') }}</span>
<span>{{ trans('labels.backend.pages.title') }}</span>
</a>
</li>
@endauth
......
@extends ('backend.layouts.app')
@section ('title', trans('labels.backend.cmspages.management') . ' | ' . trans('labels.backend.cmspages.create'))
@section ('title', trans('labels.backend.pages.management') . ' | ' . trans('labels.backend.pages.create'))
@section('page-header')
<h1>
{{ trans('labels.backend.cmspages.management') }}
<small>{{ trans('labels.backend.cmspages.create') }}</small>
{{ trans('labels.backend.pages.management') }}
<small>{{ trans('labels.backend.pages.create') }}</small>
</h1>
@endsection
@section('content')
{{ Form::open(['route' => 'admin.cmspages.store', 'class' => 'form-horizontal', 'role' => 'form', 'method' => 'post', 'id' => 'create-permission']) }}
{{ Form::open(['route' => 'admin.pages.store', 'class' => 'form-horizontal', 'role' => 'form', 'method' => 'post', 'id' => 'create-permission']) }}
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('labels.backend.cmspages.create') }}</h3>
<h3 class="box-title">{{ trans('labels.backend.pages.create') }}</h3>
<div class="box-tools pull-right">
@include('backend.includes.partials.cmspages-header-buttons')
@include('backend.includes.partials.pages-header-buttons')
</div><!--box-tools pull-right-->
</div><!-- /.box-header -->
<div class="box-body">
<div class="form-group">
{{ Form::label('title', trans('validation.attributes.backend.cmspages.title'), ['class' => 'col-lg-2 control-label required']) }}
{{ Form::label('title', trans('validation.attributes.backend.pages.title'), ['class' => 'col-lg-2 control-label required']) }}
<div class="col-lg-10">
{{ Form::text('title', null, ['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.cmspages.title'), 'required' => 'required']) }}
{{ Form::text('title', null, ['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.pages.title'), 'required' => 'required']) }}
</div><!--col-lg-10-->
</div><!--form control-->
<div class="form-group">
{{ Form::label('description', trans('validation.attributes.backend.cmspages.description'), ['class' => 'col-lg-2 control-label required']) }}
{{ Form::label('description', trans('validation.attributes.backend.pages.description'), ['class' => 'col-lg-2 control-label required']) }}
<div class="col-lg-10">
{{ Form::textarea('description', null,['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.cmspages.description')]) }}
{{ Form::textarea('description', null,['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.pages.description')]) }}
</div><!--col-lg-3-->
</div><!--form control-->
<div class="form-group">
{{ Form::label('cannonical_link', trans('validation.attributes.backend.cmspages.cannonical_link'), ['class' => 'col-lg-2 control-label']) }}
{{ Form::label('cannonical_link', trans('validation.attributes.backend.pages.cannonical_link'), ['class' => 'col-lg-2 control-label']) }}
<div class="col-lg-10">
{{ Form::text('cannonical_link', null, ['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.cmspages.cannonical_link')]) }}
{{ Form::text('cannonical_link', null, ['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.pages.cannonical_link')]) }}
</div><!--col-lg-10-->
</div><!--form control-->
<div class="form-group">
{{ Form::label('seo_title', trans('validation.attributes.backend.cmspages.seo_title'), ['class' => 'col-lg-2 control-label']) }}
{{ Form::label('seo_title', trans('validation.attributes.backend.pages.seo_title'), ['class' => 'col-lg-2 control-label']) }}
<div class="col-lg-10">
{{ Form::text('seo_title', null, ['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.cmspages.seo_title')]) }}
{{ Form::text('seo_title', null, ['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.pages.seo_title')]) }}
</div><!--col-lg-10-->
</div><!--form control-->
<div class="form-group">
{{ Form::label('seo_keyword', trans('validation.attributes.backend.cmspages.seo_keyword'), ['class' => 'col-lg-2 control-label']) }}
{{ Form::label('seo_keyword', trans('validation.attributes.backend.pages.seo_keyword'), ['class' => 'col-lg-2 control-label']) }}
<div class="col-lg-10">
{{ Form::text('seo_keyword', null, ['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.cmspages.seo_keyword')]) }}
{{ Form::text('seo_keyword', null, ['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.pages.seo_keyword')]) }}
</div><!--col-lg-10-->
</div><!--form control-->
<div class="form-group">
{{ Form::label('seo_description', trans('validation.attributes.backend.cmspages.seo_description'), ['class' => 'col-lg-2 control-label']) }}
{{ Form::label('seo_description', trans('validation.attributes.backend.pages.seo_description'), ['class' => 'col-lg-2 control-label']) }}
<div class="col-lg-10">
{{ Form::textarea('seo_description', null,['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.cmspages.seo_description')]) }}
{{ Form::textarea('seo_description', null,['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.pages.seo_description')]) }}
</div><!--col-lg-3-->
</div><!--form control-->
<div class="form-group">
{{ Form::label('status', trans('validation.attributes.backend.cmspages.is_active'), ['class' => 'col-lg-2 control-label']) }}
{{ Form::label('status', trans('validation.attributes.backend.pages.is_active'), ['class' => 'col-lg-2 control-label']) }}
<div class="col-lg-10">
<div class="control-group">
......@@ -83,7 +83,7 @@
</div><!--col-lg-3-->
</div><!--form control-->
<div class="edit-form-btn">
{{ link_to_route('admin.cmspages.index', trans('buttons.general.cancel'), [], ['class' => 'btn btn-danger btn-md']) }}
{{ link_to_route('admin.pages.index', trans('buttons.general.cancel'), [], ['class' => 'btn btn-danger btn-md']) }}
{{ Form::submit(trans('buttons.general.crud.create'), ['class' => 'btn btn-primary btn-md']) }}
<div class="clearfix"></div>
</div>
......@@ -93,6 +93,6 @@
@endsection
@section("after-scripts")
<script type="text/javascript">
FinBuilders.Cmspage.init();
FinBuilders.Pages.init();
</script>
@endsection
@extends ('backend.layouts.app')
@section ('title', trans('labels.backend.cmspages.management') . ' | ' . trans('labels.backend.cmspages.edit'))
@section ('title', trans('labels.backend.pages.management') . ' | ' . trans('labels.backend.pages.edit'))
@section('page-header')
<h1>
{{ trans('labels.backend.cmspages.management') }}
<small>{{ trans('labels.backend.cmspages.edit') }}</small>
{{ trans('labels.backend.pages.management') }}
<small>{{ trans('labels.backend.pages.edit') }}</small>
</h1>
@endsection
@section('content')
{{ Form::model($cmspage, ['route' => ['admin.cmspages.update', $cmspage], 'class' => 'form-horizontal', 'role' => 'form', 'method' => 'PATCH', 'id' => 'edit-role']) }}
{{ Form::model($cmspage, ['route' => ['admin.pages.update', $cmspage], 'class' => 'form-horizontal', 'role' => 'form', 'method' => 'PATCH', 'id' => 'edit-role']) }}
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('labels.backend.cmspages.edit') }}</h3>
<h3 class="box-title">{{ trans('labels.backend.pages.edit') }}</h3>
<div class="box-tools pull-right">
@include('backend.includes.partials.cmspages-header-buttons')
@include('backend.includes.partials.pages-header-buttons')
</div><!--box-tools pull-right-->
</div><!-- /.box-header -->
<div class="box-body">
<div class="form-group">
{{ Form::label('title', trans('validation.attributes.backend.cmspages.title'), ['class' => 'col-lg-2 control-label required']) }}
{{ Form::label('title', trans('validation.attributes.backend.pages.title'), ['class' => 'col-lg-2 control-label required']) }}
<div class="col-lg-10">
{{ Form::text('title', null, ['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.cmspages.title'), 'required' => 'required']) }}
{{ Form::text('title', null, ['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.pages.title'), 'required' => 'required']) }}
</div><!--col-lg-10-->
</div><!--form control-->
<div class="form-group">
{{ Form::label('description', trans('validation.attributes.backend.cmspages.description'), ['class' => 'col-lg-2 control-label required']) }}
{{ Form::label('description', trans('validation.attributes.backend.pages.description'), ['class' => 'col-lg-2 control-label required']) }}
<div class="col-lg-10">
{{ Form::textarea('description', null,['class' => 'form-control', 'placeholder' => trans('validation.attributes.backend.cmspages.description')]) }}
{{ Form::textarea('description', null,['class' => 'form-control', 'placeholder' => trans('validation.attributes.backend.pages.description')]) }}
</div><!--col-lg-3-->
</div><!--form control-->
<div class="form-group">
{{ Form::label('cannonical_link', trans('validation.attributes.backend.cmspages.cannonical_link'), ['class' => 'col-lg-2 control-label']) }}
{{ Form::label('cannonical_link', trans('validation.attributes.backend.pages.cannonical_link'), ['class' => 'col-lg-2 control-label']) }}
<div class="col-lg-10">
{{ Form::text('cannonical_link', null, ['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.cmspages.cannonical_link')]) }}
{{ Form::text('cannonical_link', null, ['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.pages.cannonical_link')]) }}
</div><!--col-lg-10-->
</div><!--form control-->
<div class="form-group">
{{ Form::label('seo_title', trans('validation.attributes.backend.cmspages.seo_title'), ['class' => 'col-lg-2 control-label']) }}
{{ Form::label('seo_title', trans('validation.attributes.backend.pages.seo_title'), ['class' => 'col-lg-2 control-label']) }}
<div class="col-lg-10">
{{ Form::text('seo_title', null, ['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.cmspages.seo_title')]) }}
{{ Form::text('seo_title', null, ['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.pages.seo_title')]) }}
</div><!--col-lg-10-->
</div><!--form control-->
<div class="form-group">
{{ Form::label('seo_keyword', trans('validation.attributes.backend.cmspages.seo_keyword'), ['class' => 'col-lg-2 control-label']) }}
{{ Form::label('seo_keyword', trans('validation.attributes.backend.pages.seo_keyword'), ['class' => 'col-lg-2 control-label']) }}
<div class="col-lg-10">
{{ Form::text('seo_keyword', null, ['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.cmspages.seo_keyword')]) }}
{{ Form::text('seo_keyword', null, ['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.pages.seo_keyword')]) }}
</div><!--col-lg-10-->
</div><!--form control-->
<div class="form-group">
{{ Form::label('seo_description', trans('validation.attributes.backend.cmspages.seo_description'), ['class' => 'col-lg-2 control-label']) }}
{{ Form::label('seo_description', trans('validation.attributes.backend.pages.seo_description'), ['class' => 'col-lg-2 control-label']) }}
<div class="col-lg-10">
{{ Form::textarea('seo_description', null,['class' => 'form-control', 'placeholder' => trans('validation.attributes.backend.cmspages.seo_description')]) }}
{{ Form::textarea('seo_description', null,['class' => 'form-control', 'placeholder' => trans('validation.attributes.backend.pages.seo_description')]) }}
</div><!--col-lg-3-->
</div><!--form control-->
<div class="form-group">
{{ Form::label('status', trans('validation.attributes.backend.cmspages.is_active'), ['class' => 'col-lg-2 control-label']) }}
{{ Form::label('status', trans('validation.attributes.backend.pages.is_active'), ['class' => 'col-lg-2 control-label']) }}
<div class="col-lg-10">
<div class="control-group">
......@@ -83,7 +83,7 @@
</div><!--col-lg-3-->
</div><!--form control-->
<div class="edit-form-btn">
{{ link_to_route('admin.cmspages.index', trans('buttons.general.cancel'), [], ['class' => 'btn btn-danger btn-md']) }}
{{ link_to_route('admin.pages.index', trans('buttons.general.cancel'), [], ['class' => 'btn btn-danger btn-md']) }}
{{ Form::submit(trans('buttons.general.crud.update'), ['class' => 'btn btn-primary btn-md']) }}
<div class="clearfix"></div>
</div>
......
@extends ('backend.layouts.app')
@section ('title', trans('labels.backend.cmspages.management'))
@section ('title', trans('labels.backend.pages.management'))
@section('page-header')
<h1>{{ trans('labels.backend.cmspages.management') }}</h1>
<h1>{{ trans('labels.backend.pages.management') }}</h1>
@endsection
@section('content')
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('labels.backend.cmspages.management') }}</h3>
<h3 class="box-title">{{ trans('labels.backend.pages.management') }}</h3>
<div class="box-tools pull-right">
@include('backend.includes.partials.cmspages-header-buttons')
@include('backend.includes.partials.pages-header-buttons')
</div>
</div><!-- /.box-header -->
<div class="box-body">
<div class="table-responsive data-table-wrapper">
<table id="cmspages-table" class="table table-condensed table-hover table-bordered">
<table id="pages-table" class="table table-condensed table-hover table-bordered">
<thead>
<tr>
<th>{{ trans('labels.backend.cmspages.table.title') }}</th>
<th>{{ trans('labels.backend.cmspages.table.status') }}</th>
<th>{{ trans('labels.backend.cmspages.table.createdat') }}</th>
<th>{{ trans('labels.backend.cmspages.table.updatedat') }}</th>
<th>{{ trans('labels.backend.pages.table.title') }}</th>
<th>{{ trans('labels.backend.pages.table.status') }}</th>
<th>{{ trans('labels.backend.pages.table.createdat') }}</th>
<th>{{ trans('labels.backend.pages.table.updatedat') }}</th>
<th>{{ trans('labels.general.actions') }}</th>
</tr>
</thead>
<thead class="transparent-bg">
<tr>
<th>
{!! Form::text('first_name', null, ["class" => "search-input-text form-control", "data-column" => 0, "placeholder" => trans('labels.backend.cmspages.table.title')]) !!}
{!! Form::text('first_name', null, ["class" => "search-input-text form-control", "data-column" => 0, "placeholder" => trans('labels.backend.pages.table.title')]) !!}
<a class="reset-data" href="javascript:void(0)"><i class="fa fa-times"></i></a>
</th>
<th>
{!! Form::select('status', [0 => "InActive", 1 => "Active"], null, ["class" => "search-input-select form-control", "data-column" => 1, "placeholder" => trans('labels.backend.cmspages.table.all')]) !!}
{!! Form::select('status', [0 => "InActive", 1 => "Active"], null, ["class" => "search-input-select form-control", "data-column" => 1, "placeholder" => trans('labels.backend.pages.table.all')]) !!}
</th>
<th></th>
<th></th>
......@@ -66,18 +66,18 @@
<script>
$(function() {
var dataTable = $('#cmspages-table').dataTable({
var dataTable = $('#pages-table').dataTable({
processing: true,
serverSide: true,
ajax: {
url: '{{ route("admin.cmspages.get") }}',
url: '{{ route("admin.pages.get") }}',
type: 'post'
},
columns: [
{data: 'title', name: '{{config('access.cms_page_table')}}.title'},
{data: 'status', name: '{{config('access.cms_page_table')}}.status'},
{data: 'created_at', name: '{{config('access.cms_page_table')}}.created_at'},
{data: 'updated_at', name: '{{config('access.cms_page_table')}}.updated_at'},
{data: 'title', name: '{{config('access.pages_table')}}.title'},
{data: 'status', name: '{{config('access.pages_table')}}.status'},
{data: 'created_at', name: '{{config('access.pages_table')}}.created_at'},
{data: 'updated_at', name: '{{config('access.pages_table')}}.updated_at'},
{data: 'actions', name: 'actions', searchable: false, sortable: false}
],
order: [[3, "asc"]],
......
......@@ -22,16 +22,6 @@ Route::any('generateSlug', function (\Illuminate\Http\Request $request) {
return str_slug($request['text']);
})->name('generate.slug');
/*
* CMS Pages Management
*/
Route::group(['namespace' => 'CMSPages'], function () {
Route::resource('cmspages', 'CMSPagesController', ['except' => ['show']]);
//For DataTables
Route::post('cmspages/get', 'CMSPagesTableController')->name('cmspages.get');
});
/*
* Email Templates Management
*/
......
<?php
/*
* CMS Pages Management
*/
Route::group(['namespace' => 'Pages'], function () {
Route::resource('pages', 'PagesController', ['except' => ['show']]);
//For DataTables
Route::post('pages/get', 'PagesTableController')->name('pages.get');
});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment