first commit
This commit is contained in:
47
app/Models/MedicationExpenseRow.php
Normal file
47
app/Models/MedicationExpenseRow.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user