mirror of
https://github.com/dyzulk/trustlab-api.git
synced 2026-01-26 05:15:35 +07:00
39 lines
751 B
PHP
39 lines
751 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
class Inquiry extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
public $incrementing = false;
|
|
protected $keyType = 'string';
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'email',
|
|
'category',
|
|
'subject',
|
|
'message',
|
|
'status',
|
|
'replied_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'replied_at' => 'datetime',
|
|
];
|
|
|
|
protected static function booted()
|
|
{
|
|
static::creating(function ($model) {
|
|
if (empty($model->{$model->getKeyName()})) {
|
|
$model->{$model->getKeyName()} = \App\Helpers\UuidHelper::generate();
|
|
}
|
|
});
|
|
}
|
|
}
|