Files
new_raffles/Modules/CCMS/app/Models/Testimonial.php
2025-07-27 17:40:56 +05:45

44 lines
907 B
PHP

<?php
namespace Modules\CCMS\Models;
use App\Traits\CreatedUpdatedBy;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
// use Modules\CCMS\Database\Factories\TestimonialFactory;
class Testimonial extends Model
{
use HasFactory, CreatedUpdatedBy;
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'title',
'slug',
'description',
'designation',
'company',
'image',
'branch_id',
'status',
'order',
'createdby',
'updatedby',
];
protected function image(): Attribute
{
return Attribute::make(
get: fn($value) => asset($value),
);
}
public function branch(){
return $this->belongsTo(Branch::class, 'branch_id');
}
}