fedi-feed-router/app/Models/Keyword.php

53 lines
1 KiB
PHP
Raw Normal View History

2025-07-05 23:54:43 +02:00
<?php
namespace App\Models;
2025-08-04 22:10:30 +02:00
use Illuminate\Database\Eloquent\Factories\HasFactory;
2025-07-05 23:54:43 +02:00
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
{
2025-08-04 22:10:30 +02:00
use HasFactory;
2025-07-05 23:54:43 +02:00
protected $fillable = [
'feed_id',
'platform_channel_id',
'keyword',
'is_active'
];
protected $casts = [
'is_active' => 'boolean'
];
2025-07-07 00:51:32 +02:00
/**
* @return BelongsTo<Feed, $this>
*/
2025-07-05 23:54:43 +02:00
public function feed(): BelongsTo
{
return $this->belongsTo(Feed::class);
}
2025-07-07 00:51:32 +02:00
/**
* @return BelongsTo<PlatformChannel, $this>
*/
2025-07-05 23:54:43 +02:00
public function platformChannel(): BelongsTo
{
return $this->belongsTo(PlatformChannel::class);
}
}