mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/unity.git
synced 2026-08-19 04:13:58 +00:00
41 lines
774 B
PHP
41 lines
774 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Http\Helpers\Hasher;
|
|
use Carbon\Carbon;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Permission extends Model
|
|
{
|
|
protected $table = 'permissions';
|
|
|
|
protected $hidden = [
|
|
'pivot'
|
|
];
|
|
|
|
protected $appends = [
|
|
'hash_id'
|
|
];
|
|
|
|
protected $hidden = [
|
|
'id',
|
|
];
|
|
|
|
public function getHashIdAttribute()
|
|
{
|
|
return Hasher::encode('permissions', $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') : '';
|
|
}
|
|
}
|