From dffe4de9e410a21ebef678fb191c4ff3977580d5 Mon Sep 17 00:00:00 2001 From: pxpm Date: Wed, 4 Sep 2024 12:32:42 +0100 Subject: [PATCH] add options to checklist_dependency field --- 6.x/crud-fields.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/6.x/crud-fields.md b/6.x/crud-fields.md index 20647f06..082edb94 100644 --- a/6.x/crud-fields.md +++ b/6.x/crud-fields.md @@ -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', @@ -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 ], ], ]);