Initial support for importing supplier costs
This commit is contained in:
40
app/Models/Cost.php
Normal file
40
app/Models/Cost.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
use App\Models\Cost\{Broadband,Generic,Phone};
|
||||
|
||||
class Cost extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $dates = [
|
||||
'billed_at',
|
||||
];
|
||||
|
||||
/* RELATIONS */
|
||||
|
||||
public function broadbands()
|
||||
{
|
||||
return $this->hasMany(Broadband::class)
|
||||
->where('active',TRUE);
|
||||
}
|
||||
|
||||
public function generics()
|
||||
{
|
||||
return $this->hasMany(Generic::class)
|
||||
->where('active',TRUE);
|
||||
}
|
||||
|
||||
public function phones()
|
||||
{
|
||||
return $this->hasMany(Phone::class)
|
||||
->where('active',TRUE);
|
||||
}
|
||||
|
||||
/* ATTRIBUTES */
|
||||
|
||||
}
|
Reference in New Issue
Block a user