+++ /dev/null
-<?php
-
-
-namespace Cubist\Backpack\app\Magic\Models;
-
-use Webfactor\Laravel\Backpack\NestedModels\Traits\NestedModelTrait;
-
-class CubistMagicNestedModel extends CubistMagicModel
-{
- use NestedModelTrait {
- replicate as private replicateNodeTrait;
- }
-
- public function replicate(array $except = null)
- {
- $this->replicateNodeTrait($except);
- return $this->replicateSluggable($except);
- }
-
- public function setSchema($schema)
- {
- $table = parent::setSchema($schema);
-
- $table->addColumn('parent_id', 'integer', ['unsigned' => true, 'notnull' => false]);
- $table->addIndex(['parent_id']);
- $table->addColumn('lft', 'integer', ['unsigned' => true, 'default' => 0]);
- $table->addIndex(['lft']);
- $table->addColumn('rgt', 'integer', ['unsigned' => true, 'default' => 0]);
- $table->addIndex(['rgt']);
- $table->addColumn('depth', 'integer', ['unsigned' => true, 'default' => 0]);
-
- return $table;
- }
-
- /**
- * @return string
- */
- protected function _getBaseController()
- {
- return 'CubistMagicNestedController';
- }
-}
namespace Cubist\Backpack\app\Magic\Models;
-class Settings
+class Settings extends CubistMagicModel
{
protected $table = 'cubist_settings';
protected $_options = ['name' => 'settings',
'singular' => 'setting',
'plural' => 'settings'];
+
+ public function setFields()
+ {
+ parent::setFields();
+
+ $this->addField(['name' => 'meta_title',
+ 'label' => 'Titre long par défaut',
+ 'type' => 'Text',
+ 'hint' => trans('If empty, page title is used.') . ' ' . __('Recommended length: 60 chars'),
+ 'tab' => 'SEO // Meta',
+ ]);
+
+ $this->addField([
+ 'name' => 'meta_description',
+ 'label' => 'Meta description par défaut',
+ 'type' => 'Textarea',
+ 'hint' => __('Recommended length: 160 chars'),
+ 'tab' => 'SEO // Meta',
+ ]);
+ }
}