Skip to content

Commit

Permalink
improve the form display
Browse files Browse the repository at this point in the history
  • Loading branch information
dedanirungu committed Aug 16, 2023
1 parent 14414e5 commit 8366c69
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Entities/Autoresponder.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,15 @@ public function fields(Blueprint $table = null): void
*/
public function structure($structure): array
{

$structure = [
'table' => ['subject', 'wait_period', 'table_name', 'email_field', 'date_field', 'start_date', 'end_date', 'published'],
'form' => [
['label' => 'Subject', 'class' => 'w-full', 'fields' => ['subject']],
['label' => 'Autoresponder', 'class' => 'w-1/2', 'fields' => ['wait_period', 'table_name', 'email_field', 'date_field']],
['label' => 'Setting', 'class' => 'w-1/2', 'fields' => ['start_date', 'end_date', 'published']],
['label' => 'Body', 'class' => 'w-full', 'fields' => ['body']],
],
'filter' => ['subject', 'start_date', 'end_date', 'published'],
];

Expand Down
9 changes: 8 additions & 1 deletion Entities/Campaign.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Campaign extends BaseModel
public function fields(Blueprint $table = null): void
{
$this->fields = $table ?? new Blueprint($this->table);

$this->fields->increments('id')->html('text');
$this->fields->string('subject')->html('text');
$this->fields->string('body')->html('textarea');
Expand All @@ -58,8 +58,15 @@ public function fields(Blueprint $table = null): void
*/
public function structure($structure): array
{

$structure = [
'table' => ['subject', 'send_date', 'is_sent', 'published'],
'form' => [
['label' => 'Subject', 'class' => 'w-full', 'fields' => ['subject']],
['label' => 'Date', 'class' => 'w-1/2', 'fields' => ['send_date']],
['label' => 'Setting', 'class' => 'w-1/2', 'fields' => ['is_sent', 'published']],
['label' => 'Body', 'class' => 'w-full', 'fields' => ['body']],
],
'filter' => ['subject', 'send_date', 'is_sent', 'published'],
];

Expand Down

0 comments on commit 8366c69

Please sign in to comment.