search fix

This commit is contained in:
merdan 2020-04-07 17:04:01 +05:00
parent eab9d493f2
commit d35e58ac72
4 changed files with 70 additions and 3 deletions

View File

@ -77,12 +77,12 @@ class AccountCrudController extends CrudController
[ [
'name' => 'is_active', 'name' => 'is_active',
'label' => 'Is Active', 'label' => 'Is Active',
'type' => 'boolean' 'type' => 'check'
], ],
[ [
'name' => 'is_banned', 'name' => 'is_banned',
'label' => 'Is Banned', 'label' => 'Is Banned',
'type' => 'boolean' 'type' => 'check'
] ]
]); ]);
$this->crud->setRequiredFields(StoreRequest::class, 'create'); $this->crud->setRequiredFields(StoreRequest::class, 'create');

View File

@ -25,7 +25,60 @@ class OrganiserCrudController extends CrudController
| CrudPanel Configuration | CrudPanel Configuration
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
*/ */
$this->crud->setFromDb(); // $this->crud->setFromDb();
$this->crud->setColumns([
[
'name' => 'account_id',
'label' => 'Account',
'type' => 'select',
'entity'=> 'account',
'attribute'=>'email'
],
[
'name' => 'name',
'label' => 'Name',
'type' => 'text'
],
[
'name' => 'about',
'label' => 'About',
'type' => 'text'
],
[
'name' => 'email',
'label' => trans('backpack::permissionmanager.email'),
'type' => 'email',
]
]);
$this->crud->addFields([
[
'name' => 'account_id',
'label' => 'Account',
'type' => 'select',
'entity'=> 'account',
'attribute'=>'email'
],
[
'name' => 'name',
'label' => 'Name',
'type' => 'text'
],
[
'name' => 'about',
'label' => 'About',
'type' => 'textarea'
],
[
'name' => 'phone',
'label' => 'Phone',
'type' => 'text'
],
[
'name' => 'email',
'label' => trans('backpack::permissionmanager.email'),
'type' => 'email',
]
]);
$this->crud->setRequiredFields(StoreRequest::class, 'create'); $this->crud->setRequiredFields(StoreRequest::class, 'create');
$this->crud->setRequiredFields(UpdateRequest::class, 'edit'); $this->crud->setRequiredFields(UpdateRequest::class, 'edit');
} }

View File

@ -33,6 +33,13 @@ class UserCrudController extends CrudController
'label' => trans('backpack::permissionmanager.email'), 'label' => trans('backpack::permissionmanager.email'),
'type' => 'email', 'type' => 'email',
], ],
[
'name' => 'account_id',
'label' => 'Account',
'type' => 'select',
'entity'=> 'account',
'attribute'=>'email'
]
// [ // n-n relationship (with pivot table) // [ // n-n relationship (with pivot table)
// 'label' => trans('backpack::permissionmanager.roles'), // Table column heading // 'label' => trans('backpack::permissionmanager.roles'), // Table column heading
// 'type' => 'select_multiple', // 'type' => 'select_multiple',

View File

@ -52,6 +52,13 @@ class Organiser extends MyBaseModel implements AuthenticatableContract
'organiser_logo.mimes' => 'Please select a valid image type (jpeg, jpg, png)', 'organiser_logo.mimes' => 'Please select a valid image type (jpeg, jpg, png)',
]; ];
protected $fillable = [
'account_id',
'email',
'phone',
'name'
];
/** /**
* The account associated with the organiser * The account associated with the organiser
* *