Files
aso/app/Models/Speciality.php
Server D3 Linksehat 1bf608b1ed Server 103 Commit
2024-07-18 16:05:33 +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');
}
}