mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/unity.git
synced 2026-08-19 12:24:01 +00:00
setup
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Http\Helpers\Hasher;
|
||||
use App\Http\Helpers\ImageHandel;
|
||||
|
||||
use Laravel\Passport\HasApiTokens;
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use HasApiTokens, HasRoles, Notifiable;
|
||||
|
||||
protected $guard_name = 'user';
|
||||
|
||||
protected $table = 'users';
|
||||
|
||||
protected $fillable = [
|
||||
'name', 'email', 'password',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'password',
|
||||
];
|
||||
|
||||
protected $appends = ['hash_id'];
|
||||
|
||||
public function getHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('users', $this->id);
|
||||
}
|
||||
|
||||
public function getImgAttribute($value)
|
||||
{
|
||||
$file_info = [];
|
||||
$file_info = ImageHandel::getImgFullPath($value, 'person');
|
||||
return $file_info;
|
||||
}
|
||||
|
||||
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