Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update crud-operation-show.md #481

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions 6.x/crud-operation-show.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ But you can also do both - let Backpack guess columns, and do stuff before or af
// MAYBE: do stuff after the autosetup

// for example, let's add some new columns
CRUD::column([
CRUD::addColumn([
'name' => 'table',
'label' => 'Table',
'type' => 'table',
Expand All @@ -80,7 +80,7 @@ But you can also do both - let Backpack guess columns, and do stuff before or af
'price' => 'Price',
]
]);
CRUD::column([
CRUD::addColumn([
'name' => 'fake_table',
'label' => 'Fake Table',
'type' => 'table',
Expand All @@ -92,7 +92,7 @@ But you can also do both - let Backpack guess columns, and do stuff before or af
]);

// or maybe remove a column
CRUD::column('text')->remove();
CRUD::removeColumn('text');
}
```
### Tabs - display columns in tabs
Expand All @@ -102,18 +102,22 @@ Adding the `tab` attribute to a column, will make the operation display the colu
```php
public function setupShowOperation()
{
// Enable tabs
CRUD::enableTabs();

// using the array syntax
CRUD::column([
CRUD::addColumn([
'name' => 'name',
'tab' => 'General',
]);

// or using the fluent syntax
CRUD::column('description')->tab('Another tab');
CRUD::addColumn('description')->tab('Another tab');
}
```

By default `horizontal` tabs are displayed. You can change them to `vertical` by adding in the setup function:
`$this->crud->setOperationSetting('tabsType', 'vertical')`
`CRUD::setOperationSetting('tabsType', 'vertical')`

As like any other operation settings, those can be changed globaly for all CRUDs in the `config/backpack/operations/show.php` file.

Expand Down
Loading