florida_gym/app/Models/Collection.php
2026-03-11 11:03:12 +05:30

36 lines
736 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Collection extends Model
{
protected $fillable = [
'date',
'branch_id',
'collection_type_id',
'payment_method',
'amount',
'remarks',
'transaction_id'
];
public function branch(): BelongsTo
{
return $this->belongsTo(Branch::class);
}
public function type(): BelongsTo
{
return $this->belongsTo(CollectionType::class, 'collection_type_id');
}
public function items(): HasMany
{
return $this->hasMany(CollectionItem::class);
}
}