Skip to content

Commit

Permalink
fix issue with disappearing columns in admin/email view
Browse files Browse the repository at this point in the history
  • Loading branch information
bpow committed Nov 29, 2023
1 parent 1abe8e4 commit e19f863
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions app/Http/Controllers/Admin/EmailCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ public function setup()
// TODO: remove setFromDb() and manually define Fields and Columns
$this->crud->setFromDb();

$this->crud->removeColumns(['cc', 'bcc', 'reply_to', 'sender']);
$this->crud->setColumnsDetails(['to'], ['type' => 'json_email']);
$this->crud->setColumnsDetails(['from'], ['type' => 'json_email']);
$this->crud->removeColumns(['cc', 'bcc', 'reply_to', 'sender', 'body']);
$this->crud->setColumnsDetails(['from','to'], ['type' => 'json_email']);
$this->crud->addColumn(['type' => 'datetime', 'name' => 'created_at', 'label' => 'Sent'])->makeFirstColumn();

$this->crud->orderBy('created_at', 'DESC');
Expand All @@ -55,7 +54,7 @@ public function show($id)
{
$content = $this->traitShow($id);
foreach ($content->entry->getAttributes() as $key => $value) {
if (is_null($content->entry->{$key})) {
if (is_null($value)) {
$this->crud->removeColumn($key);
}
}
Expand Down

0 comments on commit e19f863

Please sign in to comment.