mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-11 15:51:06 +03:30
fix
This commit is contained in:
+20
-21
@@ -1,27 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Package extends Model
|
||||
{
|
||||
public $fillable = ['name', 'unique_id', 'user_id', 'note', 'verified'];
|
||||
public function user()
|
||||
class Package extends Model
|
||||
{
|
||||
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');
|
||||
}
|
||||
public $fillable = [ 'name' , 'unique_id' , 'user_id' , 'note' , 'verified' , 'udi' ];
|
||||
|
||||
}
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo( 'App\User' );
|
||||
}
|
||||
|
||||
public function items()
|
||||
{
|
||||
return $this->belongsToMany( 'App\Item' , 'item_package' )->withPivot( 'count' );
|
||||
}
|
||||
|
||||
public function labels()
|
||||
{
|
||||
return $this->hasMany( 'App\Label' );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user