Erster Upload
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Batch extends Model
|
||||
{
|
||||
protected $fillable = ['lot_number', 'product_id', 'recipe_id', 'produced_at', 'expires_at'];
|
||||
|
||||
protected $casts = [
|
||||
'produced_at' => 'date',
|
||||
'expires_at' => 'date',
|
||||
];
|
||||
|
||||
public function product()
|
||||
{
|
||||
return $this->belongsTo(Product::class);
|
||||
}
|
||||
|
||||
public function recipe()
|
||||
{
|
||||
return $this->belongsTo(Recipe::class);
|
||||
}
|
||||
|
||||
public function origins()
|
||||
{
|
||||
return $this->hasMany(BatchOrigin::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user