Skip to content

Commit

Permalink
adding $rec_name to make it auto show relationship
Browse files Browse the repository at this point in the history
  • Loading branch information
dedanirungu committed Aug 12, 2023
1 parent 9a7ee99 commit 7f94395
Show file tree
Hide file tree
Showing 12 changed files with 106 additions and 20 deletions.
11 changes: 9 additions & 2 deletions Entities/BillingCycle.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ class BillingCycle extends BaseModel
*/
protected $fillable = ['title', 'slug', 'description', 'duration', 'duration_type', 'published'];

/**
* The fields that are to be render when performing relationship queries.
*
* @var array<string>
*/
public $rec_names = ['title'];

/**
* List of tables names that are need in this model during migration.
*
Expand Down Expand Up @@ -52,7 +59,7 @@ public function listTable(): ListTable

/**
* Function for defining list of fields in form view.
*
*
* @return FormBuilder
*/
public function formBuilder(): FormBuilder
Expand All @@ -73,7 +80,7 @@ public function formBuilder(): FormBuilder

/**
* Function for defining list of fields in filter view.
*
*
* @return FormBuilder
*/
public function filter(): FormBuilder
Expand Down
11 changes: 9 additions & 2 deletions Entities/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ class Gateway extends BaseModel
*/
protected $fillable = ['title', 'username', 'password', 'database', 'ip_address', 'port', 'type', 'published'];

/**
* The fields that are to be render when performing relationship queries.
*
* @var array<string>
*/
public $rec_names = ['title'];

/**
* List of tables names that are need in this model during migration.
*
Expand Down Expand Up @@ -54,7 +61,7 @@ public function listTable(): ListTable

/**
* Function for defining list of fields in form view.
*
*
* @return FormBuilder
*/
public function formBuilder(): FormBuilder
Expand All @@ -77,7 +84,7 @@ public function formBuilder(): FormBuilder

/**
* Function for defining list of fields in filter view.
*
*
* @return FormBuilder
*/
public function filter(): FormBuilder
Expand Down
11 changes: 9 additions & 2 deletions Entities/MacAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ class MacAddress extends BaseModel
*/
protected $fillable = ['subscriber_id', 'mac'];

/**
* The fields that are to be render when performing relationship queries.
*
* @var array<string>
*/
public $rec_names = ['subscriber_id', 'mac'];

/**
* List of tables names that are need in this model during migration.
*
Expand Down Expand Up @@ -50,7 +57,7 @@ public function listTable(): ListTable

/**
* Function for defining list of fields in form view.
*
*
* @return FormBuilder
*/
public function formBuilder(): FormBuilder
Expand All @@ -67,7 +74,7 @@ public function formBuilder(): FormBuilder

/**
* Function for defining list of fields in filter view.
*
*
* @return FormBuilder
*/
public function filter(): FormBuilder
Expand Down
11 changes: 9 additions & 2 deletions Entities/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ class Package extends BaseModel
'featured', 'default', 'is_unlimited', 'is_hidden', 'amount',
];

/**
* The fields that are to be render when performing relationship queries.
*
* @var array<string>
*/
public $rec_names = ['title'];

/**
* List of tables names that are need in this model during migration.
*
Expand Down Expand Up @@ -62,7 +69,7 @@ public function listTable(): ListTable

/**
* Function for defining list of fields in form view.
*
*
* @return FormBuilder
*/
public function formBuilder(): FormBuilder
Expand All @@ -88,7 +95,7 @@ public function formBuilder(): FormBuilder

/**
* Function for defining list of fields in filter view.
*
*
* @return FormBuilder
*/
public function filter(): FormBuilder
Expand Down
11 changes: 9 additions & 2 deletions Entities/PackageCharge.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ class PackageCharge extends BaseModel
*/
protected $fillable = ['title', 'slug', 'description', 'package_id', 'ledger_id', 'price', 'quantity', 'published'];

/**
* The fields that are to be render when performing relationship queries.
*
* @var array<string>
*/
public $rec_names = ['title'];

/**
* List of tables names that are need in this model during migration.
*
Expand Down Expand Up @@ -56,7 +63,7 @@ public function listTable(): ListTable

/**
* Function for defining list of fields in form view.
*
*
* @return FormBuilder
*/
public function formBuilder(): FormBuilder
Expand All @@ -79,7 +86,7 @@ public function formBuilder(): FormBuilder

/**
* Function for defining list of fields in filter view.
*
*
* @return FormBuilder
*/
public function filter(): FormBuilder
Expand Down
7 changes: 7 additions & 0 deletions Entities/PackageChargeRate.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ class PackageChargeRate extends BaseModel
*/
protected $fillable = ['package_charge_id', 'rate_id', 'published'];

/**
* The fields that are to be render when performing relationship queries.
*
* @var array<string>
*/
public $rec_names = ['package_charge_id', 'rate_id'];

/**
* List of tables names that are need in this model during migration.
*
Expand Down
11 changes: 9 additions & 2 deletions Entities/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ class Payment extends BaseModel
*/
protected $fillable = ['title', 'subscription_id', 'invoice_id', 'description', 'is_paid', 'completed', 'successful'];

/**
* The fields that are to be render when performing relationship queries.
*
* @var array<string>
*/
public $rec_names = ['title', 'subscription_id'];

/**
* List of tables names that are need in this model during migration.
*
Expand Down Expand Up @@ -54,7 +61,7 @@ public function listTable(): ListTable

/**
* Function for defining list of fields in form view.
*
*
* @return FormBuilder
*/
public function formBuilder(): FormBuilder
Expand All @@ -76,7 +83,7 @@ public function formBuilder(): FormBuilder

/**
* Function for defining list of fields in filter view.
*
*
* @return FormBuilder
*/
public function filter(): FormBuilder
Expand Down
11 changes: 9 additions & 2 deletions Entities/PaymentCharge.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ class PaymentCharge extends BaseModel
*/
protected $fillable = ['title', 'slug', 'payment_id', 'ledger_id', 'price', 'quantity', 'published'];

/**
* The fields that are to be render when performing relationship queries.
*
* @var array<string>
*/
public $rec_names = ['title'];

/**
* List of tables names that are need in this model during migration.
*
Expand Down Expand Up @@ -55,7 +62,7 @@ public function listTable(): ListTable

/**
* Function for defining list of fields in form view.
*
*
* @return FormBuilder
*/
public function formBuilder(): FormBuilder
Expand All @@ -78,7 +85,7 @@ public function formBuilder(): FormBuilder

/**
* Function for defining list of fields in filter view.
*
*
* @return FormBuilder
*/
public function filter(): FormBuilder
Expand Down
11 changes: 9 additions & 2 deletions Entities/PaymentChargeRate.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ class PaymentChargeRate extends BaseModel
*/
protected $fillable = ['payment_charge_id', 'rate_id'];

/**
* The fields that are to be render when performing relationship queries.
*
* @var array<string>
*/
public $rec_names = ['payment_charge_id', 'rate_id'];

/**
* List of tables names that are need in this model during migration.
*
Expand Down Expand Up @@ -50,7 +57,7 @@ public function listTable(): ListTable

/**
* Function for defining list of fields in form view.
*
*
* @return FormBuilder
*/
public function formBuilder(): FormBuilder
Expand All @@ -67,7 +74,7 @@ public function formBuilder(): FormBuilder

/**
* Function for defining list of fields in filter view.
*
*
* @return FormBuilder
*/
public function filter(): FormBuilder
Expand Down
9 changes: 9 additions & 0 deletions Entities/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ class Subscriber extends BaseModel
*/
protected $fillable = ['username', 'password', 'had_trail', 'partner_id'];


/**
* The fields that are to be render when performing relationship queries.
*
* @var array<string>
*/
public $rec_names = ['username'];


/**
* List of tables names that are need in this model during migration.
*
Expand Down
11 changes: 9 additions & 2 deletions Entities/SubscriberLogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ class SubscriberLogin extends BaseModel
*/
protected $fillable = ['mac', 'ip', 'username', 'link_login', 'link_orig', 'error', 'chap_id', 'chap_challenge', 'link_login_id', 'link_orig_esc', 'mac_esc'];

/**
* The fields that are to be render when performing relationship queries.
*
* @var array<string>
*/
public $rec_names = ['mac', 'username'];

/**
* List of tables names that are need in this model during migration.
*
Expand Down Expand Up @@ -56,7 +63,7 @@ public function listTable(): ListTable

/**
* Function for defining list of fields in form view.
*
*
* @return FormBuilder
*/
public function formBuilder(): FormBuilder
Expand All @@ -82,7 +89,7 @@ public function formBuilder(): FormBuilder

/**
* Function for defining list of fields in filter view.
*
*
* @return FormBuilder
*/
public function filter(): FormBuilder
Expand Down
11 changes: 9 additions & 2 deletions Entities/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ class Subscription extends BaseModel
*/
protected $fillable = ['subscriber_id', 'package_id', 'start_date', 'end_date'];

/**
* The fields that are to be render when performing relationship queries.
*
* @var array<string>
*/
public $rec_names = ['subscriber_id', 'package_id'];

/**
* List of tables names that are need in this model during migration.
*
Expand Down Expand Up @@ -52,7 +59,7 @@ public function listTable(): ListTable

/**
* Function for defining list of fields in form view.
*
*
* @return FormBuilder
*/
public function formBuilder(): FormBuilder
Expand All @@ -71,7 +78,7 @@ public function formBuilder(): FormBuilder

/**
* Function for defining list of fields in filter view.
*
*
* @return FormBuilder
*/
public function filter(): FormBuilder
Expand Down

0 comments on commit 7f94395

Please sign in to comment.