65 lines
1.3 KiB
PHP
65 lines
1.3 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
use GeneaLabs\LaravelModelCaching\Traits\Cachable;
|
|
|
|
/**
|
|
* Class Category
|
|
*
|
|
* @property int $id
|
|
* @property int $country_locale_id
|
|
* @property string|null $name
|
|
* @property string $short_name
|
|
* @property string|null $slug
|
|
* @property bool $enabled
|
|
* @property bool $is_top
|
|
* @property int $_lft
|
|
* @property int $_rgt
|
|
* @property int|null $parent_id
|
|
* @property string|null $deleted_at
|
|
* @property Carbon|null $created_at
|
|
* @property Carbon|null $updated_at
|
|
* @property CountryLocale $country_locale
|
|
*/
|
|
class Category extends Model
|
|
{
|
|
use SoftDeletes, Cachable;
|
|
|
|
protected $table = 'categories';
|
|
|
|
protected $casts = [
|
|
'country_locale_id' => 'int',
|
|
'enabled' => 'bool',
|
|
'is_top' => 'bool',
|
|
'_lft' => 'int',
|
|
'_rgt' => 'int',
|
|
'parent_id' => 'int',
|
|
];
|
|
|
|
protected $fillable = [
|
|
'country_locale_id',
|
|
'name',
|
|
'short_name',
|
|
'slug',
|
|
'description',
|
|
'enabled',
|
|
'is_top',
|
|
'_lft',
|
|
'_rgt',
|
|
'parent_id',
|
|
];
|
|
|
|
public function country_locale()
|
|
{
|
|
return $this->belongsTo(CountryLocale::class);
|
|
}
|
|
}
|