45 lines
841 B
PHP
45 lines
841 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use App\Enums\KeywordCategoryEnum;
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @property integer $id
|
||
|
|
* @property string $label
|
||
|
|
* @property string $keyword_cat
|
||
|
|
* @property string $created_at
|
||
|
|
* @property string $updated_at
|
||
|
|
* @property Keywordable[] $keywordables
|
||
|
|
*/
|
||
|
|
class Keyword extends Model
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* @var array
|
||
|
|
*/
|
||
|
|
protected $fillable = [
|
||
|
|
'label',
|
||
|
|
'keyword_cat',
|
||
|
|
'created_at',
|
||
|
|
'updated_at'
|
||
|
|
];
|
||
|
|
|
||
|
|
/**
|
||
|
|
* The attributes that should be cast.
|
||
|
|
*
|
||
|
|
* @var array
|
||
|
|
*/
|
||
|
|
protected $casts = [
|
||
|
|
'keyword_cat' => KeywordCategoryEnum::class
|
||
|
|
];
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||
|
|
*/
|
||
|
|
public function keywordables()
|
||
|
|
{
|
||
|
|
return $this->hasMany('App\Models\Keywordable');
|
||
|
|
}
|
||
|
|
}
|