This commit is contained in:
sajjad
2023-09-23 02:29:26 -07:00
parent 4f570bb7ef
commit cf58a63013
136 changed files with 29612 additions and 5125 deletions
+20 -21
View File
@@ -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' );
}
}