ldc-legaulois/app/Models/DeliveryAddress.php
2026-09-25 16:25:31 +02:00

57 lines
1.2 KiB
PHP

<?php
namespace App\Models;
use App\Enums\Shop\ContactFormCivility;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* @property int $id
* @property \App\Enums\ContactFormCivility $civility
* @property string $lastname
* @property string $firstname
* @property string $address
* @property string $postcode
* @property string $phone
* @property string $city
* @property int $order_id
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
*/
class DeliveryAddress extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'civility',
'lastname',
'firstname',
'address',
'postcode',
'city',
'phone',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'civility' => ContactFormCivility::class,
];
// * RELATIONSHIPS
/**
* Get the order that are assigned this delivery address.
*/
public function order(): BelongsTo
{
return $this->belongsTo(Order::class);
}
}