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 8b8d945 commit 7f621af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
10 changes: 3 additions & 7 deletions Entities/Detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
namespace Modules\Product\Entities;

use Illuminate\Database\Schema\Blueprint;
use Modules\Base\Classes\Views\FormBuilder;
use Modules\Base\Classes\Views\ListTable;
use Modules\Base\Entities\BaseModel;

class Detail extends BaseModel
Expand Down Expand Up @@ -47,7 +45,7 @@ class Detail extends BaseModel
public function fields(Blueprint $table = null): void
{
$this->fields = $table ?? new Blueprint($this->table);

$this->fields->increments('id');
$this->fields->integer('product_id')->nullable()->html('text');
$this->fields->integer('trn_no')->nullable()->html('text');
Expand All @@ -60,10 +58,8 @@ public function fields(Blueprint $table = null): void
*/
public function structure($structure): array
{
$structure = [
'table' => ['product_id', 'trn_no', 'stock_in', 'stock_out'],
'filter' => ['product_id', 'trn_no', ],
];
$structure['table'] = ['product_id', 'trn_no', 'stock_in', 'stock_out'];
$structure['filter'] = ['product_id', 'trn_no'];

return $structure;
}
Expand Down
14 changes: 6 additions & 8 deletions Entities/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,13 @@ public function fields(Blueprint $table = null): void
public function structure($structure): array
{

$structure = [
'table' => ['name', 'product_type_id', 'category_id', 'tax_cat_id', 'vendor', 'cost_price', 'sale_price'],
'form' => [
['label' => 'Name', 'class' => 'w-full', 'fields' => ['name']],
['label' => 'Product', 'class' => 'w-1/2', 'fields' => ['product_type_id', 'category_id', 'tax_cat_id']],
['label' => 'Setting', 'class' => 'w-1/2', 'fields' => ['vendor', 'cost_price', 'sale_price']],
],
'filter' => ['name', 'product_type_id', 'category_id', 'tax_cat_id'],
$structure['table'] = ['name', 'product_type_id', 'category_id', 'tax_cat_id', 'vendor', 'cost_price', 'sale_price'];
$structure['form'] = [
['label' => 'Name', 'class' => 'col-span-full', 'fields' => ['name']],
['label' => 'Product', 'class' => 'col-span-6', 'fields' => ['product_type_id', 'category_id', 'tax_cat_id']],
['label' => 'Setting', 'class' => 'col-span-6', 'fields' => ['vendor', 'cost_price', 'sale_price']],
];
$structure['filter'] = ['name', 'product_type_id', 'category_id', 'tax_cat_id'];

return $structure;
}
Expand Down

0 comments on commit 7f621af

Please sign in to comment.