mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/unity.git
synced 2026-08-19 20:34:01 +00:00
31 lines
655 B
PHP
31 lines
655 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Http\Helpers\Hasher;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Carbon\Carbon;
|
|
|
|
class Entity extends Model
|
|
{
|
|
protected $table = 'entities';
|
|
|
|
protected $appends = ['hash_id'];
|
|
|
|
public function getHashIdAttribute()
|
|
{
|
|
return Hasher::encode('entities', $this->id);
|
|
}
|
|
|
|
public function getUpdatedAtAttribute($date)
|
|
{
|
|
return $date ? Carbon::parse($date)->timezone('Asia/Kuala_Lumpur')->format('Y-m-d') : '';
|
|
}
|
|
|
|
public function getCreatedAtAttribute($date)
|
|
{
|
|
return $date ? Carbon::parse($date)->timezone('Asia/Kuala_Lumpur')->format('Y-m-d') : '';
|
|
}
|
|
}
|