2023-02-22 11:51:36 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
2023-06-21 10:24:56 +00:00
|
|
|
use App\Enums\Packaging\OriginEnum;
|
|
|
|
|
use App\Enums\Packaging\WatchTypeEnum;
|
|
|
|
|
use App\Enums\Packaging\TypeEnum;
|
|
|
|
|
use App\Enums\Packaging\MaterialEnum;
|
|
|
|
|
use App\Enums\Packaging\BenefitEnum;
|
2023-02-23 16:23:00 +01:00
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
2023-02-22 11:51:36 +01:00
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @property integer $id
|
|
|
|
|
* @property integer $user_id
|
|
|
|
|
* @property boolean $watch_type
|
|
|
|
|
* @property string $supplier
|
|
|
|
|
* @property string $name
|
|
|
|
|
* @property string $product_description
|
|
|
|
|
* @property boolean $origin
|
|
|
|
|
* @property boolean $is_sample
|
|
|
|
|
* @property boolean $type_packaging
|
|
|
|
|
* @property boolean $material
|
|
|
|
|
* @property boolean $benefit
|
|
|
|
|
* @property string $observation
|
|
|
|
|
* @property string $picture
|
|
|
|
|
* @property string $url
|
|
|
|
|
* @property string $documents
|
|
|
|
|
* @property string $fair
|
|
|
|
|
* @property string $created_at
|
|
|
|
|
* @property string $updated_at
|
|
|
|
|
* @property string $deleted_at
|
|
|
|
|
* @property User $user
|
|
|
|
|
*/
|
|
|
|
|
class Packaging extends Model
|
|
|
|
|
{
|
2023-02-23 16:23:00 +01:00
|
|
|
use HasFactory;
|
|
|
|
|
|
2023-02-22 11:51:36 +01:00
|
|
|
/**
|
|
|
|
|
* @var array
|
|
|
|
|
*/
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'user_id',
|
|
|
|
|
'watch_type',
|
|
|
|
|
'supplier',
|
|
|
|
|
'name',
|
|
|
|
|
'product_description',
|
|
|
|
|
'origin',
|
|
|
|
|
'is_sample',
|
|
|
|
|
'type_packaging',
|
|
|
|
|
'material',
|
|
|
|
|
'benefit',
|
|
|
|
|
'observation',
|
|
|
|
|
'picture',
|
|
|
|
|
'url',
|
|
|
|
|
'documents',
|
|
|
|
|
'fair',
|
|
|
|
|
'created_at',
|
|
|
|
|
'updated_at',
|
|
|
|
|
'deleted_at'
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The attributes that should be cast.
|
|
|
|
|
*
|
|
|
|
|
* @var array
|
|
|
|
|
*/
|
|
|
|
|
protected $casts = [
|
2023-06-21 10:24:56 +00:00
|
|
|
'watch_type' => WatchTypeEnum::class,
|
|
|
|
|
'origin' => OriginEnum::class,
|
2023-02-22 11:51:36 +01:00
|
|
|
'is_sample' => 'boolean',
|
2023-06-21 10:24:56 +00:00
|
|
|
'type_packaging' => TypeEnum::class,
|
|
|
|
|
'material' => MaterialEnum::class,
|
|
|
|
|
'benefit' => BenefitEnum::class,
|
2023-02-23 16:23:00 +01:00
|
|
|
'picture' => 'json',
|
|
|
|
|
'documents' => 'json',
|
2023-02-22 11:51:36 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
|
*/
|
|
|
|
|
public function user()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo('App\Models\User');
|
|
|
|
|
}
|
|
|
|
|
}
|