ldc-groupe/app/Models/MailContactData.php

95 lines
3.5 KiB
PHP

<?php
namespace App\Models;
use App\Enums\Contact\BreedType;
use App\Enums\Contact\ContactFormType;
use App\Enums\Contact\CustomerAskingType;
use App\Enums\Contact\ExportAskingType;
use App\Enums\Contact\PressType;
use App\Enums\Department;
use Illuminate\Database\Eloquent\Casts\AsEnumArrayObject;
use Illuminate\Database\Eloquent\Model;
/**
* This class is used to store data in memory only, not in databases.
*
* @property integer $id Id.
* @property \App\Enums\Contact\ContactFormType $enumType The type enum.
* @property string $lastname The customer's lastname.
* @property string $firstname The customer's firstname.
* @property string $message The message.
* @property string $email The customer's email.
* @property string|null $phone The customer's phone.
* @property \App\Enums\Contact\BreedType[] $typeelevage The customer's breeding type
* @property \App\Enums\Department[] $zonegeo The customer's greographic zone
* @property string $company The customer's company.
* @property string $country The customer's country.
* @property string $town The customer's town.
* @property string $postalcode The customer's postalcode.
* @property boolean $newsletter The customer's optin response.
* @property \App\Enums\Contact\CustomerAskingType[] $type The customer's type asking
* @property \App\Enums\Contact\ExportAskingType[] $typeExport The customer's type asking
* @property \App\Enums\Contact\PressType $subject The message's subject
* @property-read \Carbon\Carbon $created_at Created date.
* @property-read \Carbon\Carbon $updated_at Updated date.
*/
class MailContactData extends Model
{
/**
* The database connection that should be used by the model.
*
* @var string
*/
protected $connection = null;
/**
* The attributes that are mass assignable.
*
* @var list<string>
*/
protected $fillable = [
'enumType',
'lastname',
'firstname',
'message',
'email',
'phone',
'typeelevage',
'zonegeo',
'company',
'country',
'town',
'postalcode',
'type',
'typeExport',
'subject',
'newsletter',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'enumType' => ContactFormType::class,
'typeelevage' => AsEnumArrayObject::class . ':' . BreedType::class,
'zonegeo' => AsEnumArrayObject::class . ':' . Department::class,
'type' => AsEnumArrayObject::class . ':' . CustomerAskingType::class,
'typeExport' => AsEnumArrayObject::class . ':' . ExportAskingType::class,
'subject' => PressType::class,
];
/**
* Construct method.
*
* @param array $attributes
* @phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod
*/
public function __construct(array $attributes = [])
{
// phpcs:enable
parent::__construct($attributes);
}
}