added primary keys to all models
This commit is contained in:
@@ -9,6 +9,9 @@ class Invoice extends Model
|
||||
//Table Name
|
||||
protected $table = 'alliance_mining_tax_invoices';
|
||||
|
||||
//Primary Key
|
||||
public $primaryKey = 'id';
|
||||
|
||||
//Timestamps
|
||||
public $timestamps = true;
|
||||
|
||||
@@ -28,7 +31,7 @@ class Invoice extends Model
|
||||
];
|
||||
|
||||
public function getPayment() {
|
||||
return $this->hasMany('App\Models\MiningTax\Payment', 'invoice_id', 'invoice_id');
|
||||
return $this->hasOne(App\Models\MiningTax\Payment::class, 'invoice_id', 'invoice_id');
|
||||
}
|
||||
|
||||
public function getCharacterId() {
|
||||
@@ -44,7 +47,7 @@ class Invoice extends Model
|
||||
}
|
||||
|
||||
public function getLedgers() {
|
||||
return $this->hasMany('App\Models\MiningTax\Ledger', 'invoice_id', 'invoice_id');
|
||||
return $this->hasMany(App\Models\MiningTax\Ledger::class, 'invoice_id', 'invoice_id');
|
||||
}
|
||||
|
||||
public function getInvoiceAmount() {
|
||||
|
||||
@@ -9,6 +9,9 @@ class Ledger extends Model
|
||||
//Table Name
|
||||
protected $table = 'alliance_mining_tax_ledgers';
|
||||
|
||||
//Primary Key
|
||||
public $primaryKey = 'id';
|
||||
|
||||
//Timestamps
|
||||
public $timestamps = false;
|
||||
|
||||
@@ -31,7 +34,7 @@ class Ledger extends Model
|
||||
];
|
||||
|
||||
public function getInvoice() {
|
||||
return $this->belongsTo('App\Models\MiningTax\Invoice', 'invoice_id', 'invoice_id');
|
||||
return $this->belongsTo(App\Models\MiningTax\Invoice::class, 'invoice_id', 'invoice_id');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,9 @@ class Observer extends Model
|
||||
//Table Name
|
||||
protected $table = 'alliance_mining_tax_observers';
|
||||
|
||||
//Primary Key
|
||||
public $primaryKey = 'id';
|
||||
|
||||
//Timestamps
|
||||
public $timestamps = true;
|
||||
|
||||
@@ -21,11 +24,5 @@ class Observer extends Model
|
||||
'last_updated',
|
||||
'observer_id',
|
||||
'observer_type',
|
||||
];
|
||||
|
||||
public function getLedgers() {
|
||||
return $this->hasMany('App\Models\MiningTax\Ledger', 'observer_id', 'observer_id');
|
||||
}
|
||||
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
@@ -9,6 +9,9 @@ class Payment extends Model
|
||||
//Table Name
|
||||
protected $table = 'alliance_mining_tax_payments';
|
||||
|
||||
//Primary Key
|
||||
public $primaryKey = 'id';
|
||||
|
||||
//Timestamps
|
||||
public $timestamps = true;
|
||||
|
||||
@@ -28,6 +31,6 @@ class Payment extends Model
|
||||
];
|
||||
|
||||
public function getInvoice() {
|
||||
return $this->belongsTo('App\Models\MiningTax\Invoice', 'invoice_id', 'invoice_id');
|
||||
return $this->belongsTo(App\Models\MiningTax\Invoice::class, 'invoice_id', 'invoice_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user