Fix Doctor By Speciality
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Traits\Blameable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class Speciality extends Model
|
||||
{
|
||||
@@ -20,4 +21,22 @@ class Speciality extends Model
|
||||
'code',
|
||||
'name'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'deleted_at',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
protected $appends = [
|
||||
'image_url'
|
||||
];
|
||||
|
||||
public function getImageUrlAttribute()
|
||||
{
|
||||
return asset('images/specialities/'.Str::slug($this->name, '-').'.png');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user