Files
aibuddytool/app/Models/Category.php
Charles T 500714d7bf Update (config): enable canonical
Update (migration): Add category type
Add (admin): Add post cliffhanger
2023-08-03 19:46:32 +08:00

66 lines
1.3 KiB
PHP

<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use GeneaLabs\LaravelModelCaching\Traits\Cachable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
* 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 = [
'type',
'country_locale_id',
'name',
'short_name',
'slug',
'description',
'enabled',
'is_top',
'_lft',
'_rgt',
'parent_id',
];
public function country_locale()
{
return $this->belongsTo(CountryLocale::class);
}
}