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