Files
aso/app/Models/Speciality.php
Linksehat Staging Server ce024c2bcd merge
2023-05-08 08:50:15 +07:00

43 lines
796 B
PHP
Executable File

<?php
namespace App\Models;
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
{
use HasFactory, SoftDeletes, Blameable;
protected $fillable = [
'code',
'name'
];
protected $guarded = [
'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');
}
}