class PageController extends Controller
{
- public function index($slug)
+ public function index($slug = 'home')
{
$page = Page::findBySlug($slug);
- if (!$page)
- {
- abort(404, 'Please go back to our <a href="'.url('').'">homepage</a>.');
+ if (!$page) {
+ abort(404, 'Please go back to our <a href="' . url('') . '">homepage</a>.');
}
$this->data['title'] = $page->title;
$this->data['page'] = $page->withFakes();
- return view('pages.'.$page->template, $this->data);
+ return view('pages.' . $page->template, $this->data);
}
}
| - page slug
*/
- private function _seo()
+ protected function _common()
+ {
+ $this->crud->addField([
+ 'name' => 'status',
+ 'type' => 'select_from_array',
+ 'default' => '0',
+ 'label' => __('Status'),
+ 'options' => ['0' => __('Offline'),'1' => __('Published')],
+ 'fake' => true,
+ 'store_in' => 'extras',
+
+ ]);
+ $this->_seo();
+ }
+
+ protected function _seo()
{
$this->crud->addField([ // CustomHTML
'name' => 'metas_separator',
'type' => 'custom_html',
'value' => '<br><h2>' . trans('SEO') . '</h2><hr>',
+ 'tab' => 'Meta // SEO'
]);
$this->crud->addField([
'name' => 'meta_title',
'fake' => true,
'hint' => trans('If empty, page title is used.') . ' ' . __('Recommended length: 60 chars'),
'store_in' => 'extras',
+ 'tab' => 'Meta // SEO',
]);
$this->crud->addField([
'name' => 'meta_description',
'fake' => true,
'store_in' => 'extras',
'hint' => __('Recommended length: 160 chars'),
+ 'tab' => 'Meta // SEO',
]);
$this->crud->addField([
'name' => 'robots',
'default' => true,
'fake' => true,
'store_in' => 'extras',
+ 'tab' => 'Meta // SEO',
+ ]);
+ }
+
+ private function home()
+ {
+ $this->_common();
+
+ $this->crud->addField([
+ 'name' => 'slideshow',
+ 'type' => 'list_model',
+ 'model' => 'slideshow',
+ 'label' => __('Slideshow'),
+ 'fake' => true,
+ 'store_in' => 'extras',
]);
}
private function services()
{
- $this->_seo();
+ $this->_common();
$this->crud->addField([ // CustomHTML
'name' => 'content_separator',
'type' => 'custom_html',
private function about_us()
{
- $this->_seo();
+ $this->_common();
$this->crud->addField([
'name' => 'content',
'label' => trans('backpack::pagemanager.content'),
"license": "proprietary",
"require": {
"cubist/cms-front": "dev-master",
+ "cubist/gtag": "dev-master",
"cubist/laravel-backpack-bundle": "dev-master"
},
"config": {
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "9e32b5e26f854885353e45547b29ab5f",
+ "content-hash": "7e2c66d6444a70f5099e77ad765596e3",
"packages": [
{
"name": "almasaeed2010/adminlte",
"source": {
"type": "git",
"url": "git://git.cubedesigners.com/cubist_cms-front.git",
- "reference": "37d2b3ed3af202574ef2a8cb981490c4fbef2c5e"
+ "reference": "84d1fbacc18f028b361eb5e1989591e852695560"
},
"dist": {
"type": "tar",
- "url": "https://composer.cubedesigners.com/dist/cubist/cms-front/cubist-cms-front-dev-master-576f27.tar",
- "reference": "37d2b3ed3af202574ef2a8cb981490c4fbef2c5e",
- "shasum": "57e8d5a9638d846490aca6ddce030a9c5b95fc28"
+ "url": "https://composer.cubedesigners.com/dist/cubist/cms-front/cubist-cms-front-dev-master-0537d3.tar",
+ "reference": "84d1fbacc18f028b361eb5e1989591e852695560",
+ "shasum": "3682974fb34898a0924c8b1c9838c149ef3e1665"
},
"require": {
+ "cubist/gtag": "dev-master",
"laravel/framework": "5.7.*",
"php": ">=7.1.3",
"spatie/laravel-googletagmanager": "^2.6",
}
],
"description": "Cubist CMS Front",
- "time": "2019-02-22T14:18:18+00:00"
+ "time": "2019-02-25T16:10:11+00:00"
+ },
+ {
+ "name": "cubist/gtag",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "git://git.cubedesigners.com/cubist_gtag.git",
+ "reference": "d7d3245892e01fc7f8c7676bab6391f34f6207db"
+ },
+ "dist": {
+ "type": "tar",
+ "url": "https://composer.cubedesigners.com/dist/cubist/gtag/cubist-gtag-dev-master-d31d9c.tar",
+ "reference": "d7d3245892e01fc7f8c7676bab6391f34f6207db",
+ "shasum": "b5000e4f86ab4aa6b0c5b60a944fd7e4a2156944"
+ },
+ "require": {
+ "laravel/framework": "5.7.*",
+ "php": ">=5.5.0"
+ },
+ "type": "library",
+ "extra": {
+ "laravel": {
+ "providers": [
+ "Cubist\\Gtag\\GtagServiceProvider"
+ ]
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Cubist\\Gtag\\": "src"
+ }
+ },
+ "license": [
+ "proprietary"
+ ],
+ "authors": [
+ {
+ "name": "Vincent Vanwaelscappel",
+ "email": "vincent@cubedesigners.com"
+ }
+ ],
+ "description": "Google analytics tracking code for Laravel",
+ "keywords": [
+ "cubist",
+ "google analytics",
+ "gtag"
+ ],
+ "time": "2019-02-25T15:06:11+00:00"
},
{
"name": "cubist/laravel-backpack-bundle",
},
{
"name": "cviebrock/eloquent-sluggable",
- "version": "4.6.0",
+ "version": "4.7.0",
"source": {
"type": "git",
"url": "https://github.com/cviebrock/eloquent-sluggable.git",
- "reference": "d8a6982d32a7fe92f42b1c33a34e89d33516c2fd"
+ "reference": "e05e778d3ff87a010b0dd73aab00a7c72761ff81"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/cviebrock/eloquent-sluggable/zipball/d8a6982d32a7fe92f42b1c33a34e89d33516c2fd",
- "reference": "d8a6982d32a7fe92f42b1c33a34e89d33516c2fd",
+ "url": "https://api.github.com/repos/cviebrock/eloquent-sluggable/zipball/e05e778d3ff87a010b0dd73aab00a7c72761ff81",
+ "reference": "e05e778d3ff87a010b0dd73aab00a7c72761ff81",
"shasum": ""
},
"require": {
"slug",
"sluggable"
],
- "time": "2018-09-05T02:03:48+00:00"
+ "time": "2019-02-24T19:36:12+00:00"
},
{
"name": "dnoegel/php-xdg-base-dir",
},
{
"name": "studio-42/elfinder",
- "version": "2.1.46",
+ "version": "2.1.47",
"source": {
"type": "git",
"url": "https://github.com/Studio-42/elFinder.git",
- "reference": "67799d42e7ee0afd3ed13e95f935694a8b3820d1"
+ "reference": "6884c4f0b742bd343cb2c873321fc9bb0cbde3fa"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Studio-42/elFinder/zipball/67799d42e7ee0afd3ed13e95f935694a8b3820d1",
- "reference": "67799d42e7ee0afd3ed13e95f935694a8b3820d1",
+ "url": "https://api.github.com/repos/Studio-42/elFinder/zipball/6884c4f0b742bd343cb2c873321fc9bb0cbde3fa",
+ "reference": "6884c4f0b742bd343cb2c873321fc9bb0cbde3fa",
"shasum": ""
},
"require": {
],
"description": "File manager for web",
"homepage": "http://elfinder.org",
- "time": "2019-01-14T03:59:31+00:00"
+ "time": "2019-02-25T00:08:43+00:00"
},
{
"name": "swiftmailer/swiftmailer",
"minimum-stability": "dev",
"stability-flags": {
"cubist/cms-front": 20,
+ "cubist/gtag": 20,
"cubist/laravel-backpack-bundle": 20
},
"prefer-stable": true,
/*
* The Google Tag Manager id, should be a code that looks something like "gtm-xxxx".
*/
- 'id' => env('GOOGLE_ANALYTICS_ID', ''),
+ 'id' => env('GOOGLE_TAGMANAGER_ID', ''),
/*
* Enable or disable script rendering. Useful for local development.
*/
- 'enabled' => env('GOOGLE_ANALYTICS_ID', '') != '',
+ 'enabled' => env('GOOGLE_TAGMANAGER_ID', '') != '',
/*
* If you want to use some macro's you 'll probably store them
--- /dev/null
+@extends('layouts.app')
--- /dev/null
+<!-- field_type_name -->
+<div @include('crud::inc.field_wrapper_attributes') >
+ <label>{!! $field['label'] !!}</label>
+ <input
+ type="text"
+ name="{{ $field['name'] }}"
+ value="{{ old($field['name']) ? old($field['name']) : (isset($field['value']) ? $field['value'] : (isset($field['default']) ? $field['default'] : '' )) }}"
+ @include('crud::inc.field_attributes')
+ >
+
+ {{-- HINT --}}
+ @if (isset($field['hint']))
+ <p class="help-block">{!! $field['hint'] !!}</p>
+ @endif
+</div>
+
+@if ($crud->checkIfFieldIsFirstOfItsType($field))
+ {{-- FIELD EXTRA CSS --}}
+ {{-- push things in the after_styles section --}}
+
+ @push('crud_fields_styles')
+ <!-- no styles -->
+ @endpush
+
+ {{-- FIELD EXTRA JS --}}
+ {{-- push things in the after_scripts section --}}
+
+ @push('crud_fields_scripts')
+ <!-- no scripts -->
+ @endpush
+@endif
+
+{{--// Note: most of the times you'll want to use @if ($crud->checkIfFieldIsFirstOfItsType($field, $fields)) to only load CSS/JS once, even though there are multiple instances of it.--}}
|
*/
-Route::get('/', function () {
- return view('welcome');
-});
-
/** CATCH-ALL ROUTE for Backpack/PageManager - needs to be at the end of your routes.php file **/
Route::get('{page}/{subs?}', ['uses' => 'PageController@index'])
->where(['page' => '^((?!admin).)*$', 'subs' => '.*']);