Files
backend-mm/app/Models/Ecommerce/Product/Order/Shipping/OrderShippingMethod.php
Mekan1206 dd633ef7da WIP
2026-04-29 23:45:51 +05:00

66 lines
1.3 KiB
PHP

<?php
namespace App\Models\Ecommerce\Product\Order\Shipping;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Spatie\Sluggable\HasSlug;
use Spatie\Sluggable\SlugOptions;
use Spatie\Translatable\HasTranslations;
class OrderShippingMethod extends Model
{
use HasFactory;
use HasSlug;
use HasTranslations;
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'order_shipping_methods';
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'name',
'slug',
'description',
'price',
'is_active',
];
/**
* Translatable fields
*
* @var array<int, string>
*/
public $translatable = [
'name',
'description',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'is_active' => 'boolean',
];
/**
* Get the options for generating the slug.
*/
public function getSlugOptions(): SlugOptions
{
return SlugOptions::create()
->generateSlugsFrom('name')
->saveSlugsTo('slug');
}
}