generated from liutk/owl-admin-base
39 lines
724 B
PHP
39 lines
724 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use EloquentFilter\Filterable;
|
|
|
|
class Contact extends Model
|
|
{
|
|
use HasFactory;
|
|
use Filterable;
|
|
|
|
protected function serializeDate(\DateTimeInterface $date)
|
|
{
|
|
return $date->format('Y-m-d H:i:s');
|
|
}
|
|
|
|
protected $casts = [
|
|
'created_at' => 'datetime:Y-m-d H:i:s',
|
|
'updated_at' => 'datetime:Y-m-d H:i:s',
|
|
'status' => 'boolean',
|
|
];
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'phone',
|
|
'company',
|
|
'type',
|
|
'content',
|
|
];
|
|
|
|
|
|
public function scopeSort($q)
|
|
{
|
|
$q->orderBy('created_at', 'desc');
|
|
}
|
|
}
|