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 8b4efd7 commit 9e84fe5
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 37 deletions.
18 changes: 8 additions & 10 deletions Entities/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,15 @@ public function fields(Blueprint $table = null): void
*/
public function structure($structure): array
{
$structure = [
'table' => ['title', 'ledger_id', 'currency_id', 'consumer_key', 'consumer_secret', 'initiator_name', 'passkey', 'business_shortcode', 'phone_number', 'method', 'published'],
'form' => [
['label' => 'Title', 'class' => 'w-full', 'fields' => ['title', 'slug']],
['label' => 'Main', 'class' => 'w-1/2', 'fields' => ['ledger_id', 'currency_id', 'consumer_key', 'consumer_secret', 'initiator_name', 'initiator_password']],
['label' => 'Other', 'class' => 'w-1/2', 'fields' => ['party_a', 'party_b', 'type', 'passkey', 'business_shortcode', 'phone_number', 'method']],
['label' => 'Title', 'class' => 'w-full', 'fields' => ['default', 'sandbox', 'published']],
['label' => 'Title', 'class' => 'w-full', 'fields' => ['description']],
],
'filter' => ['ledger_id', 'currency_id'],
$structure['table'] = ['title', 'ledger_id', 'currency_id', 'consumer_key', 'consumer_secret', 'initiator_name', 'passkey', 'business_shortcode', 'phone_number', 'method', 'published'];
$structure['form'] = [
['label' => 'Title', 'class' => 'col-span-full', 'fields' => ['title', 'slug']],
['label' => 'Main', 'class' => 'col-span-6', 'fields' => ['ledger_id', 'currency_id', 'consumer_key', 'consumer_secret', 'initiator_name', 'initiator_password']],
['label' => 'Other', 'class' => 'col-span-6', 'fields' => ['party_a', 'party_b', 'type', 'passkey', 'business_shortcode', 'phone_number', 'method']],
['label' => 'Title', 'class' => 'col-span-full', 'fields' => ['default', 'sandbox', 'published']],
['label' => 'Title', 'class' => 'col-span-full', 'fields' => ['description']],
];
$structure['filter'] = ['ledger_id', 'currency_id'];

return $structure;
}
Expand Down
6 changes: 2 additions & 4 deletions Entities/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,8 @@ public function fields(Blueprint $table = null): void
*/
public function structure($structure): array
{
$structure = [
'table' => ['first_name', 'middle_name', 'last_name', 'msisdn', 'trans_type', 'trans_id', 'trans_time', 'trans_amount', 'business_short_code', 'bill_ref_number', 'invoice_number', 'completed', 'successful', 'published'],
'filter' => ['msisdn', 'trans_amount', 'business_short_code', 'bill_ref_number', 'invoice_number', 'completed', 'successful', 'published'],
];
$structure['table'] = ['first_name', 'middle_name', 'last_name', 'msisdn', 'trans_type', 'trans_id', 'trans_time', 'trans_amount', 'business_short_code', 'bill_ref_number', 'invoice_number', 'completed', 'successful', 'published'];
$structure['filter'] = ['msisdn', 'trans_amount', 'business_short_code', 'bill_ref_number', 'invoice_number', 'completed', 'successful', 'published'];

return $structure;
}
Expand Down
6 changes: 2 additions & 4 deletions Entities/Simulate.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,8 @@ public function fields(Blueprint $table = null): void
*/
public function structure($structure): array
{
$structure = [
'table' => ['amount', 'phone', 'reference', 'gateway_id', 'completed', 'successful'],
'filter' => ['amount', 'phone', 'reference', 'gateway_id', 'completed', 'successful'],
];
$structure ['table'] = ['amount', 'phone', 'reference', 'gateway_id', 'completed', 'successful'];
$structure ['filter'] = ['amount', 'phone', 'reference', 'gateway_id', 'completed', 'successful'];

return $structure;
}
Expand Down
16 changes: 7 additions & 9 deletions Entities/Stkpush.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,14 @@ public function fields(Blueprint $table = null): void
public function structure($structure): array
{

$structure = [
'table' => ['amount', 'phone', 'reference', 'command', 'gateway_id', 'completed', 'successful', 'merchant_request_id', 'checkout_request_id'],
'form' => [
['label' => 'Phone', 'class' => 'w-full', 'fields' => ['phone']],
['label' => 'Stkpush', 'class' => 'w-1/2', 'fields' => ['amount', 'reference', 'merchant_request_id', 'checkout_request_id']],
['label' => 'Setting', 'class' => 'w-1/2', 'fields' => ['gateway_id', 'completed', 'successful']],
['label' => 'Description', 'class' => 'w-full', 'fields' => ['description']],
],
'filter' => ['amount', 'phone', 'reference', 'command', 'gateway_id', 'completed', 'successful'],
$structure['table'] = ['amount', 'phone', 'reference', 'command', 'gateway_id', 'completed', 'successful', 'merchant_request_id', 'checkout_request_id'];
$structure['form'] = [
['label' => 'Phone', 'class' => 'col-span-full', 'fields' => ['phone']],
['label' => 'Stkpush', 'class' => 'col-span-6', 'fields' => ['amount', 'reference', 'merchant_request_id', 'checkout_request_id']],
['label' => 'Setting', 'class' => 'col-span-6', 'fields' => ['gateway_id', 'completed', 'successful']],
['label' => 'Description', 'class' => 'col-span-full', 'fields' => ['description']],
];
$structure['filter'] = ['amount', 'phone', 'reference', 'command', 'gateway_id', 'completed', 'successful'];

return $structure;
}
Expand Down
14 changes: 6 additions & 8 deletions Entities/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,13 @@ public function fields(Blueprint $table = null): void
*/
public function structure($structure): array
{
$structure = [
'table' => ['slug', 'confirmation_url', 'validation_url', 'paybill_till', 'shortcode', 'published'],
'form' => [
['label' => 'slug', 'class' => 'w-full', 'fields' => ['slug']],
['label' => 'Webhook', 'class' => 'w-1/2', 'fields' => ['paybill_till', 'shortcode', 'published']],
['label' => 'Url', 'class' => 'w-1/2', 'fields' => ['confirmation_url', 'validation_url']],
],
'filter' => ['slug', 'confirmation_url', 'validation_url', 'paybill_till', 'published'],
$structure['table'] = ['slug', 'confirmation_url', 'validation_url', 'paybill_till', 'shortcode', 'published'];
$structure['form'] = [
['label' => 'slug', 'class' => 'col-span-full', 'fields' => ['slug']],
['label' => 'Webhook', 'class' => 'col-span-6', 'fields' => ['paybill_till', 'shortcode', 'published']],
['label' => 'Url', 'class' => 'col-span-6', 'fields' => ['confirmation_url', 'validation_url']],
];
$structure['filter'] = ['slug', 'confirmation_url', 'validation_url', 'paybill_till', 'published'];

return $structure;
}
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/stkpush.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Phone Number
</label>
<input
class="shadow appearance-none border rounded w-full py-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
class="shadow appearance-none border rounded col-span-full py-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
id="phone" value="{{ $phone }}" @if ($request_sent) readonly @endif name="phone"
type="number" placeholder="Phone">
</div>
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/tillno.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
MPESA CODE
</label>
<input
class="shadow appearance-none border rounded w-full py-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
class="shadow appearance-none border rounded col-span-full py-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
id="mpesa_code" name="mpesa_code" type="text" placeholder="MPesa Code">
</div>
<div style="text-align:center; margin-top:20px;">
Expand Down

0 comments on commit 9e84fe5

Please sign in to comment.