Add (keyword model)
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
* @property string|null $metadata
|
||||
* @property string|null $bites
|
||||
* @property string|null $keyword_list
|
||||
* @property bool $keyword_saved
|
||||
* @property string|null $impact
|
||||
* @property string $impact_level
|
||||
* @property Carbon $published_at
|
||||
@@ -45,6 +46,7 @@ class RssPost extends Model implements Feedable
|
||||
'metadata' => 'object',
|
||||
'keywords' => 'array',
|
||||
'entities' => 'array',
|
||||
'keyword_saved' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
@@ -64,6 +66,7 @@ class RssPost extends Model implements Feedable
|
||||
'impact_level',
|
||||
'published_at',
|
||||
'status',
|
||||
'keyword_saved',
|
||||
];
|
||||
|
||||
public function category()
|
||||
|
||||
49
app/Models/RssPostKeyword.php
Normal file
49
app/Models/RssPostKeyword.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class RssPostKeyword
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $rss_post_id
|
||||
* @property string $type
|
||||
* @property bool $is_main
|
||||
* @property string $value
|
||||
* @property string $value_lowercased
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
*
|
||||
* @property RssPost $rss_post
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class RssPostKeyword extends Model
|
||||
{
|
||||
protected $table = 'rss_post_keywords';
|
||||
|
||||
protected $casts = [
|
||||
'rss_post_id' => 'int',
|
||||
'is_main' => 'bool'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'rss_post_id',
|
||||
'type',
|
||||
'is_main',
|
||||
'value',
|
||||
'value_lowercased'
|
||||
];
|
||||
|
||||
public function rss_post()
|
||||
{
|
||||
return $this->belongsTo(RssPost::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user