ldc-legaulois/app/Models/DeliveryAddress.php
Jérémy Munsch 9b4af94e73
Closes #39 Send Orders as Email to arcadia and keep generated files
-  clean files after one month
- Dispatch emails as database jobs (retry on fail)
- add command to trigger cleanup of old xml files
2023-09-18 18:17:00 +02:00

66 lines
1.6 KiB
PHP

<?php
namespace App\Models;
use App\Enums\ContactFormCivility;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Kwaadpepper\Enum\Traits\CastsEnums;
/**
*
* @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
*
* @property-read \App\Models\Order $order
* @package App\Models
*/
class DeliveryAddress extends Model
{
use CastsEnums;
/**
* The attributes that should be cast to Enums.
*
* @var array
*/
protected $enumCasts = [
'civility' => ContactFormCivility::class
];
/**
* The attributes that are mass assignable.
*
* @var string[]
*/
protected $fillable = [
'civility',
'lastname',
'firstname',
'address',
'postcode',
'city',
'phone'
];
// * RELATIONSHIPS
/**
* Get the order that owns the DeliveryAddress
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function order(): BelongsTo
{
return $this->belongsTo(Order::class);
}
}