mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-12 13:41:07 +03:30
fix: change models namespace
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user