35 lines
805 B
PHP
35 lines
805 B
PHP
<?php
|
|
|
|
namespace Modules\Seller\Entities;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Carbon\Carbon;
|
|
|
|
// model binding
|
|
use Modules\Seller\Entities\ProductBuzzerServices;
|
|
|
|
class ProductBuzzer extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'tbl_product_buzzer_product';
|
|
protected $fillable = [
|
|
'id', 'id_services', 'name', 'icon',
|
|
'is_active', 'created_at', 'updated_at'
|
|
];
|
|
|
|
protected $keyType = 'string';
|
|
public $incrementing = false;
|
|
|
|
public function productService()
|
|
{
|
|
return $this->hasMany(ProductBuzzerServices::class, 'id', 'id_services');
|
|
}
|
|
|
|
public function getCreatedAtAttribute($value)
|
|
{
|
|
return Carbon::parse($value)->format('Y-m-d H:i:s');
|
|
}
|
|
}
|