osb/app/Models/Cost.php

40 lines
608 B
PHP
Raw Normal View History

<?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 */
}