public function show($id)
{
- dd($id);
-
$this->crud->hasAccessOrFail('show');
// get entry ID from Request (makes sure its the last ID for nested resources)
// set columns from db
if ($setFromDb) {
- $this->crud->setFromDb();
+ $this->crud->setShowColumns($this->data['entry']);
}
// cycle through columns
foreach ($this->crud->columns() as $key => $column) {
-
- debug($column);
// remove any autoset relationship columns
if (array_key_exists('model', $column) && array_key_exists('autoset', $column) && $column['autoset']) {
$this->crud->removeColumn($column['key']);
protected $_columnType = 'text';
protected $_columnMoveAfter = false;
protected $_columnFormat = null;
+ protected $_preview = true;
protected $_adminType = 'text';
protected $_viewNamespace = 'crud::fields';
protected $_columnViewNamespace = 'crud::columns';
protected $_searchLogic = 'text';
+
protected $_databaseType = 'text';
protected $_databaseUnique = false;
protected $_databaseIndex = false;
return ['type' => $this->_adminType, 'view_namespace' => $this->_viewNamespace, 'column' => false, 'form' => 'both', 'rules' => '',
'fillable' => true, 'guarded' => false, 'hidden' => false,
'translatable' => $this->_translatable, 'migrateTranslatable' => $this->_migrateTranslatable,
- 'column_type' => $this->_columnType, 'column_move_after' => $this->_columnMoveAfter, 'column_format' => $this->_columnFormat,
+ 'preview' => $this->_preview, 'column_type' => $this->_columnType, 'column_move_after' => $this->_columnMoveAfter, 'column_format' => $this->_columnFormat,
'default' => '', 'cast' => $this->_cast, 'column_view_namespace' => $this->_columnViewNamespace, 'searchLogic' => $this->_searchLogic,
'allow_null' => true,
'can' => $this->_can, 'auth' => $this->_auth,
if (null !== $this->getAttribute('can', null)) {
if (!can($this->getAttribute('can'))) {
- $this->setAttribute('column',false);
+ $this->setAttribute('preview', false);
+ $this->setAttribute('column', false);
$this->setAttribute('auth', false);
$this->setAttribute('type', 'authhidden');
$this->setAttribute('view_namespace', CubistBackpackServiceProvider::NAMESPACE . '::fields');