43 lines
880 B
PHP
43 lines
880 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Support\Carbon;
|
|
|
|
/**
|
|
* @property int $id
|
|
* @property int $feed_id
|
|
* @property Feed $feed
|
|
* @property int $platform_channel_id
|
|
* @property PlatformChannel $platformChannel
|
|
* @property string $keyword
|
|
* @property bool $is_active
|
|
* @property Carbon $created_at
|
|
* @property Carbon $updated_at
|
|
*/
|
|
class Keyword extends Model
|
|
{
|
|
protected $fillable = [
|
|
'feed_id',
|
|
'platform_channel_id',
|
|
'keyword',
|
|
'is_active'
|
|
];
|
|
|
|
protected $casts = [
|
|
'is_active' => 'boolean'
|
|
];
|
|
|
|
public function feed(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Feed::class);
|
|
}
|
|
|
|
public function platformChannel(): BelongsTo
|
|
{
|
|
return $this->belongsTo(PlatformChannel::class);
|
|
}
|
|
|
|
}
|