Commit bb0b8d37 authored by Vipul Basapati's avatar Vipul Basapati

Changed CmsPages To Pages Module

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