}
}
+ if (!$model->isRevisionEnabled()) {
+ $this->revisionEnabled = false;
+ }
$this->crud->setRoute(backpack_url($this->_routeURL));
$this->crud->setEntityNameStrings(__($this->_singular), __($this->_plural));
public function getDatabaseType()
{
if ($this->getAttribute('translatable')) {
- return 'text';
+ if ($this->_databaseType === 'text') {
+ return 'longtext';
+ } else {
+ return 'text';
+ }
}
return $this->_databaseType;
}
addField as protected bunchAddField;
}
- protected static $_doctrineTypesMapping = ['int' => 'integer'];
+ protected static $_doctrineTypesMapping = ['int' => 'integer', 'longtext' => 'blob'];
protected $connection = null;
protected $primaryKey = 'id';
public function __construct(array $attributes = [])
{
$this->setup();
+
parent::__construct($attributes);
+
}
public function setup()
{
+ $this->revisionEnabled = $this->_enableRevisions;
if (null !== $this->connection) {
$this->setConnection($this->connection);
}
return $res;
}
+ public function isRevisionEnabled()
+ {
+ return $this->_enableRevisions;
+ }
+
protected function _replaceInCode($stub, $dest)
{
$singular = $this->getOption('singular', $this->getOption('name'));
*/
public function onBeforeUpdate($controller, $request)
{
- $this->saveLanguageFile($controller, $request);
- parent::onBeforeUpdate($controller, $request); // TODO: Change the autogenerated stub
+ $this->saveLanguageFile();
+ parent::onBeforeUpdate($controller, $request);
}
return parent::_sortLocales($a, $b);
}
+
+ public function getKey()
+ {
+ return 1;
+ }
}
@include('cubist_back::form.shortcuts')
</div>
+ @stack('after_form')
+
@endsection
</div>
@include('cubist_back::form.shortcuts')
</div>
+
+ @stack('after_form')
@endsection