65 lines
1.9 KiB
PHP
65 lines
1.9 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Cviebrock\EloquentSluggable\Sluggable;
|
|
|
|
|
|
/**
|
|
* Class DcCategory
|
|
*
|
|
* @property int $id
|
|
* @property string $name
|
|
* @property int $pos
|
|
* @property string $slug
|
|
* @property Carbon|null $created_at
|
|
* @property Carbon|null $updated_at
|
|
* @package App\Models
|
|
* @property bool $active
|
|
* @method static \Illuminate\Database\Eloquent\Builder|DcCategory findSimilarSlugs(string $attribute, array $config, string $slug)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|DcCategory newModelQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|DcCategory newQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|DcCategory query()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|DcCategory whereActive($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|DcCategory whereCreatedAt($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|DcCategory whereId($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|DcCategory whereName($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|DcCategory wherePos($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|DcCategory whereSlug($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|DcCategory whereUpdatedAt($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|DcCategory withUniqueSlugConstraints(\Illuminate\Database\Eloquent\Model $model, string $attribute, array $config, string $slug)
|
|
* @mixin \Eloquent
|
|
*/
|
|
class DcCategory extends Model
|
|
{
|
|
use Sluggable;
|
|
|
|
protected $table = 'dc_categories';
|
|
|
|
protected $casts = [
|
|
'pos' => 'int',
|
|
'active' => 'bool'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'pos',
|
|
'slug',
|
|
'active'
|
|
];
|
|
|
|
public function sluggable() : array
|
|
{
|
|
return [
|
|
'slug' => [
|
|
'source' => 'name'
|
|
]
|
|
];
|
|
}
|
|
}
|