32 lines
636 B
PHP
32 lines
636 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Dcat\Admin\Traits\HasDateTimeFormatter;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class OfflineProductCategory extends Model
|
|
{
|
|
use HasFactory, HasDateTimeFormatter;
|
|
|
|
protected $attributes = [
|
|
'enabled' => false,
|
|
'sort' => 0,
|
|
];
|
|
|
|
protected $casts = [
|
|
'enabled' => 'bool',
|
|
];
|
|
|
|
protected $fillable = [
|
|
'name', 'enabled', 'color', 'sort',
|
|
];
|
|
|
|
public function scopeEnabled(Builder $builder)
|
|
{
|
|
$builder->where('enabled', true);
|
|
}
|
|
}
|