// SYSTEM PANEL //
[ROOT]
/
mnt
/
pleskStorage
/
vhosts
/
kodsolutions.net
/
subdomains
/
go-rent.kodsolutions.net
/
app
/
Models
[ PARENT ]
EDIT :: Admin.php
<?php namespace App\Models; use Spatie\Permission\Traits\HasRoles; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; class Admin extends Authenticatable { use HasFactory; use HasRoles; protected $fillable = [ 'name', 'email', 'mobile', 'active', 'gender', 'image', 'password', 'birth_date' ]; /** * The attributes that should be hidden for serialization. * * @var array<int, string> */ protected $hidden = [ 'password', 'remember_token', ]; /** * The attributes that should be cast. * * @var array<string, string> */ protected $casts = [ 'email_verified_at' => 'datetime', ]; public function setPasswordAttribute($pass) { $this->attributes['password'] = bcrypt($pass); } public function scopeRecent($query) { return $query->orderBy('id', 'desc'); } public function getImagePathAttribute() { $value = $this->image; if ($value != '') { $value = asset($value); } else { $value = asset('/logo.svg'); } return $value; } }
SAVE
CANCEL