mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-10 22:31:06 +03:30
28 lines
585 B
PHP
28 lines
585 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Package extends Model
|
|
{
|
|
public $fillable = ['name', 'unique_id', 'user_id', 'note', 'verified'];
|
|
public function user()
|
|
{
|
|
return $this->belongsTo('App\User');
|
|
}
|
|
public function items()
|
|
{
|
|
return $this->belongsToMany('App\Item', 'item_package')->withPivot('count');
|
|
}
|
|
// public function packs()
|
|
// {
|
|
// return $this->belongsToMany('App\Pack', 'pack_package');
|
|
// }
|
|
public function labels()
|
|
{
|
|
return $this->hasMany('App\Label');
|
|
}
|
|
|
|
}
|