You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
778 B

12 months ago
<?php
namespace App\Models;
use DateTimeInterface;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Cache;
use OwenIt\Auditing\Contracts\Auditable;
class CommonModel extends Model implements Auditable
{
use DynamicallyTableModelTrait;
use FilterRequestColumnModelTrait;
use \OwenIt\Auditing\Auditable;
protected $table;
protected $guarded = ['id'];
protected $casts = [
'created_at' => 'datetime:Y-m-d H:i:s',
'updated_at' => 'datetime:Y-m-d H:i:s',
'deleted_at' => 'datetime:Y-m-d H:i:s',
];
public $glue = ",";
protected function serializeDate(DateTimeInterface $date)
{
return $date->format(Carbon::parse($date)->toDateTimeString());
}
}