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
+26
View File
@@ -0,0 +1,26 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
class Cycle extends Model
{
public $fillable = [
'date', 'user_id', 'cycle_number', 'sterilizer_id', 'note', 'verified', 'unique_id'
];
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function labels(): BelongsToMany
{
return $this->belongsToMany(Label::class, 'cycle_label')
->withPivot('count');
}
}