mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-12 03:41:07 +03:30
change pack to label
This commit is contained in:
+8
-4
@@ -6,18 +6,22 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Package extends Model
|
||||
{
|
||||
public $fillable = ['name', 'unique_id', 'user_id', 'note', 'verified'];
|
||||
public $fillable = ['name', 'unique_id', 'user_id', 'note', 'verified', 'label_id'];
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\User');
|
||||
}
|
||||
public function items()
|
||||
{
|
||||
return $this->belongsToMany('App\Item', 'item_package');
|
||||
return $this->belongsToMany('App\Item', 'item_package')->withPivot('count');
|
||||
}
|
||||
public function packs()
|
||||
// public function packs()
|
||||
// {
|
||||
// return $this->belongsToMany('App\Pack', 'pack_package');
|
||||
// }
|
||||
public function labels()
|
||||
{
|
||||
return $this->belongsToMany('App\Pack', 'pack_package');
|
||||
return $this->hasMany('App\Label');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user