Skip to content
Merged
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
6 changes: 6 additions & 0 deletions 6.x/crud-fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,9 @@ CRUD::field([ // two interconnected entities
'model' => "Backpack\PermissionManager\app\Models\Role", // foreign key model
'pivot' => true, // on create&update, do you need to add/delete pivot table entries?]
'number_columns' => 3, //can be 1,2,3,4,6
'options' => (function ($query) {
return $query->where('name', '!=', 'admin');
}), // force the related options to be a custom query, instead of all(); you can use this to filter the available options
],
'secondary' => [
'label' => 'Permission',
Expand All @@ -366,6 +369,9 @@ CRUD::field([ // two interconnected entities
'model' => "Backpack\PermissionManager\app\Models\Permission", // foreign key model
'pivot' => true, // on create&update, do you need to add/delete pivot table entries?]
'number_columns' => 3, //can be 1,2,3,4,6
'options' => (function ($query) {
return $query->where('name', '!=', 'admin');
}), // force the related options to be a custom query, instead of all(); you can use this to filter the available options
],
],
]);
Expand Down