add pack and update items & packegs & cycles

This commit is contained in:
Fayyazi
2019-09-07 13:49:04 +04:30
parent 3522700605
commit 976e4c075b
39 changed files with 628 additions and 111 deletions
+23
View File
@@ -0,0 +1,23 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Pack extends Model
{
public $fillable = ['name', 'sterile_date', 'expire_date', 'sterilizer_id', 'cycle_number', 'lot_number', 'department', 'user_id', 'note'];
public function user()
{
return $this->belongsTo('App\User');
}
public function packages()
{
return $this->belongsToMany('App\Package', 'pack_package');
}
public function cycles()
{
return $this->belongsToMany('App\Cycle', 'cycle_pack');
}
}