ldc-legaulois/app/Models/DeliveryAddress.php
2024-10-08 11:57:56 +02:00

58 lines
1.5 KiB
PHP

<?php
namespace App\Models;
use App\Enums\Shop\ContactFormCivility;
use Illuminate\Database\Eloquent\Model;
/**
* @property integer $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 integer $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.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function order(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(Order::class);
}
}