mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/unity.git
synced 2026-08-27 16:24:15 +00:00
setup
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?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'];
|
||||
|
||||
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') : '';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user