April 2026 waren Wirtschaft Feedback
This commit is contained in:
parent
02f2a4c23e
commit
9ce711d6b2
167 changed files with 25278 additions and 8518 deletions
72
app/Models/Production.php
Normal file
72
app/Models/Production.php
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Production extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'product_id',
|
||||
'location_id',
|
||||
'produced_by',
|
||||
'produced_at',
|
||||
'quantity',
|
||||
'notes',
|
||||
'mhd_warning',
|
||||
];
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'produced_at' => 'date',
|
||||
'mhd_warning' => 'boolean',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsTo<Product, $this>
|
||||
*/
|
||||
public function product(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Product::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsTo<Location, $this>
|
||||
*/
|
||||
public function location(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Location::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function producedByUser(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'produced_by');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return HasMany<ProductionIngredient, $this>
|
||||
*/
|
||||
public function productionIngredients(): HasMany
|
||||
{
|
||||
return $this->hasMany(ProductionIngredient::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return HasMany<ProductionPackaging, $this>
|
||||
*/
|
||||
public function productionPackagings(): HasMany
|
||||
{
|
||||
return $this->hasMany(ProductionPackaging::class);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue