20-02-2026
This commit is contained in:
parent
854ce02bf6
commit
4d6b4930b2
128 changed files with 18247 additions and 2093 deletions
48
app/Models/ProductWoodOrigin.php
Normal file
48
app/Models/ProductWoodOrigin.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
|
||||
class ProductWoodOrigin extends Model
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\ProductWoodOriginFactory> */
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'product_id',
|
||||
'wood_species',
|
||||
'origin_country',
|
||||
'origin_region',
|
||||
'harvest_year',
|
||||
'forest_operator',
|
||||
'sustainability_certificate',
|
||||
'eudr_reference_id',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'harvest_year' => 'integer',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gehört zu einem Produkt.
|
||||
*/
|
||||
public function product(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Product::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* EUDR-Dokumente (polymorphe Beziehung via Media).
|
||||
*/
|
||||
public function media(): MorphMany
|
||||
{
|
||||
return $this->morphMany(Media::class, 'model');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue