fix: change models namespace

This commit is contained in:
amir-ys
2024-11-07 16:41:50 +03:30
parent 865d565a91
commit acb9871379
71 changed files with 732 additions and 688 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
class Label extends Model
{
public $fillable = [
'sterile_date', 'expire_date', 'sterilizer_id', 'cycle_number', 'lot_number', 'user_id',
'package_id'
];
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function package(): BelongsTo
{
return $this->belongsTo(Package::class);
}
public function cycles(): BelongsToMany
{
return $this->belongsToMany(Cycle::class, 'cycle_label')
->withPivot('count');
}
}