mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-10 20:51:07 +03:30
26 lines
599 B
PHP
26 lines
599 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Item extends Model
|
|
{
|
|
public $fillable = [ 'name' , 'size' , 'unique_id' , 'specific' , 'note' , 'user_id' , 'udi' , 'status' ];
|
|
|
|
public function packages()
|
|
{
|
|
return $this->belongsToMany( 'App\Package' , 'item_package' )->withPivot( 'count' );
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo( 'App\User' );
|
|
}
|
|
|
|
public function files()
|
|
{
|
|
return $this->morphMany( 'App\Media' , 'model' );
|
|
}
|
|
}
|