Files
econom/app/Models/MedicationExpenseRow.php
brusnitsyn fb2e6c58e3
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (8.3) (push) Has been cancelled
tests / ci (8.4) (push) Has been cancelled
tests / ci (8.5) (push) Has been cancelled
first commit
2026-04-06 00:06:00 +09:00

48 lines
1.2 KiB
PHP

<?php
namespace App\Models;
use Database\Factories\MedicationExpenseRowFactory;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
#[Fillable(['report_period_id', 'department_id'])]
class MedicationExpenseRow extends Model
{
/** @use HasFactory<MedicationExpenseRowFactory> */
use HasFactory;
/**
* Get the period that owns the row.
*
* @return BelongsTo<ReportPeriod, $this>
*/
public function reportPeriod(): BelongsTo
{
return $this->belongsTo(ReportPeriod::class);
}
/**
* Get the department that owns the row.
*
* @return BelongsTo<Department, $this>
*/
public function department(): BelongsTo
{
return $this->belongsTo(Department::class);
}
/**
* Get the values for the row.
*
* @return HasMany<MedicationExpenseValue, $this>
*/
public function values(): HasMany
{
return $this->hasMany(MedicationExpenseValue::class);
}
}