Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| ProductionOutput | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| order | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| product | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Models; |
| 4 | |
| 5 | use App\Models\admin\Product; |
| 6 | use Illuminate\Database\Eloquent\Model; |
| 7 | |
| 8 | class ProductionOutput extends Model |
| 9 | { |
| 10 | protected $fillable = ['production_order_id', 'product_id', 'qty', 'is_byproduct']; |
| 11 | |
| 12 | protected $casts = [ |
| 13 | 'qty' => 'decimal:4', |
| 14 | 'is_byproduct' => 'boolean', |
| 15 | ]; |
| 16 | |
| 17 | public function order() |
| 18 | { |
| 19 | return $this->belongsTo(ProductionOrder::class, 'production_order_id'); |
| 20 | } |
| 21 | |
| 22 | public function product() |
| 23 | { |
| 24 | return $this->belongsTo(Product::class); |
| 25 | } |
| 26 | } |