Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 3 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| StockTransfer | |
0.00% |
0 / 3 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
| items | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| fromWarehouse | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| toWarehouse | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Models; |
| 4 | |
| 5 | use Illuminate\Database\Eloquent\Model; |
| 6 | |
| 7 | class StockTransfer extends Model |
| 8 | { |
| 9 | protected $fillable = ['reference', 'from_warehouse_id', 'to_warehouse_id', 'status', 'note', 'created_by']; |
| 10 | |
| 11 | public function items() |
| 12 | { |
| 13 | return $this->hasMany(StockTransferItem::class); |
| 14 | } |
| 15 | |
| 16 | public function fromWarehouse() |
| 17 | { |
| 18 | return $this->belongsTo(Warehouse::class, 'from_warehouse_id'); |
| 19 | } |
| 20 | |
| 21 | public function toWarehouse() |
| 22 | { |
| 23 | return $this->belongsTo(Warehouse::class, 'to_warehouse_id'); |
| 24 | } |
| 25 | } |