Skip to content

Commit

Permalink
loading layout from backend
Browse files Browse the repository at this point in the history
  • Loading branch information
dedanirungu committed Aug 18, 2023
1 parent 26bc4e9 commit 7c5b4a0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 29 deletions.
12 changes: 5 additions & 7 deletions Entities/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,12 @@ public function fields(Blueprint $table = null): void
*/
public function structure($structure): array
{
$structure = [
'table' => ['name', 'phone', 'published'],
'form' => [
['label' => 'Name', 'class' => 'w-full', 'fields' => ['name']],
['label' => 'Contact', 'class' => 'w-1/2', 'fields' => ['phone', 'ordering', 'published']],
],
'filter' => ['name', 'phone', 'published'],
$structure['table'] = ['name', 'phone', 'published'];
$structure['form'] = [
['label' => 'Name', 'class' => 'col-span-full', 'fields' => ['name']],
['label' => 'Contact', 'class' => 'col-span-6', 'fields' => ['phone', 'ordering', 'published']],
];
$structure['filter'] = ['name', 'phone', 'published'];

return $structure;
}
Expand Down
12 changes: 5 additions & 7 deletions Entities/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,12 @@ public function fields(Blueprint $table = null): void
*/
public function structure($structure): array
{
$structure = [
'table' => ['name', 'url', 'ordering', 'published'],
'form' => [
['label' => 'Name', 'class' => 'w-full', 'fields' => ['name']],
['label' => 'Contact', 'class' => 'w-1/2', 'fields' => ['url', 'ordering', 'published']],
],
'filter' => ['name', 'url', 'published'],
$structure['table'] = ['name', 'url', 'ordering', 'published'];
$structure['form'] = [
['label' => 'Name', 'class' => 'col-span-full', 'fields' => ['name']],
['label' => 'Contact', 'class' => 'col-span-6', 'fields' => ['url', 'ordering', 'published']],
];
$structure['filter'] = ['name', 'url', 'published'];

return $structure;
}
Expand Down
12 changes: 5 additions & 7 deletions Entities/Outgoing.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,12 @@ public function fields(Blueprint $table = null): void
*/
public function structure($structure): array
{
$structure = [
'table' => ['phone', 'sms', 'is_sent'],
'form' => [
['label' => 'Phone', 'class' => 'w-full', 'fields' => ['phone']],
['label' => 'Contact', 'class' => 'w-1/2', 'fields' => [ 'sms', 'is_sent']],
],
'filter' => ['phone', 'is_sent'],
$structure['table'] = ['phone', 'sms', 'is_sent'];
$structure['form'] = [
['label' => 'Phone', 'class' => 'col-span-full', 'fields' => ['phone']],
['label' => 'Contact', 'class' => 'col-span-6', 'fields' => ['sms', 'is_sent']],
];
$structure['filter'] = ['phone', 'is_sent'];

return $structure;
}
Expand Down
14 changes: 6 additions & 8 deletions Entities/Signature.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Signature extends BaseModel
public function fields(Blueprint $table = null): void
{
$this->fields = $table ?? new Blueprint($this->table);

$this->fields->increments('id')->html('text');
$this->fields->char('title', 255)->html('text');
$this->fields->string('signature')->html('textarea');
Expand All @@ -58,14 +58,12 @@ public function fields(Blueprint $table = null): void
*/
public function structure($structure): array
{
$structure = [
'table' => ['title', 'signature', 'ordering', 'published'],
'form' => [
['label' => 'Title', 'class' => 'w-full', 'fields' => ['title']],
['label' => 'Contact', 'class' => 'w-1/2', 'fields' => ['signature', 'ordering', 'published']],
],
'filter' => ['title', 'signature', 'published'],
$structure['table'] = ['title', 'signature', 'ordering', 'published'];
$structure['form'] = [
['label' => 'Title', 'class' => 'col-span-full', 'fields' => ['title']],
['label' => 'Contact', 'class' => 'col-span-6', 'fields' => ['signature', 'ordering', 'published']],
];
$structure['filter'] = ['title', 'signature', 'published'];

return $structure;
}
Expand Down

0 comments on commit 7c5b4a0

Please sign in to comment.