Details Row

Shows a + (plus sign) next to each table row, so that the user can expand that row and reveal details. You are responsible for creting the view with those details.

enableDetailsRow() - show the + sign in the table view

$this->crud->enableDetailsRow();
// NOTE: you also need to do allow access to the right users:
$this->crud->allowAccess('details_row');
// NOTE: you also need to do overwrite the showDetailsRow($id) method in your EntityCrudController to show whatever you'd like in the details row OR overwrite the views/backpack/crud/details_row.blade.php
$this->crud->setDetailsRowView('your-view');

disableDetailsRow() - hide the + sign in the table view

$this->crud->disableDetailsRow();

Export Buttons

Please note it will only export the current page of results. So in order to export all entries the user needs to make the current page show "All" entries from the top-left picker.

enableExportButtons() - Show export to PDF, CSV, XLS and Print buttons on the table view

Actions Column

setActionsColumnPriority() - make the actions column (in the table view) hide when not enough space is available, by giving it an unreasonable priority

$this->crud->setActionsColumnPriority(10000);

Custom / Advanced Queries

addClause() - change what entries are shown in the table view; this allows developers to forcibly change the query used by the table view, as opposed to filters, that allow users to change the query with new inputs;

Create & Update Operations

Note: The last parameter is always the form - create or update. If missing, it's assumed both.

addField() - add one field to the create / update or both forms

$this->crud->addField($field_definition_array, 'update/create/both');
$this->crud->addField('db_column_name', 'update/create/both'); // a lazy way to add fields: let the CRUD decide what field type it is and set it automatically, along with the field label

addFields() - add multiple fields to the create / update or both forms

Reorder

Show a reorder button in the table view, next to Add. Provides an interface to reorder & nest elements, provided the parent_id, lft, rgt, depth columns are in the database, and $fillable on the model.

enableReorder() - enable the Reorder functionality

$this->crud->enableReorder('label_name', 3);
// NOTE: the second parameter is the maximum nesting depth; this example will prevent the user from creating trees deeper than 3 levels;
// NOTE: you also need to do allow access to the right users:
$this->crud->allowAccess('reorder');

disableReorder() - disable the Reorder functionality

$this->crud->disableReorder();

isReorderEnabled() - returns true/false if the Reorder operation is enabled or not

$this->crud->isReorderEnabled();

Revisions

A.k.a. Audit Trail. Tracks all changes to an entry and provides an interface to revert to a previous state. In order to use this, you also need to use \Venturecraft\Revisionable\RevisionableTrait;. Please check out the Revision Operation for more info.

Help & Support

Community

Company

Login for the full experience

If you decide to use Backpack in your projects, please create an account. You'll get ultra-fast search in documentation, important security updates, monthly newsletter - all free, after you click one button. Plus, you'll never see this pop-up again.