Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| ArticlePublication | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| article | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Models; |
| 4 | |
| 5 | use Database\Factories\ArticlePublicationFactory; |
| 6 | use Illuminate\Database\Eloquent\Factories\HasFactory; |
| 7 | use Illuminate\Database\Eloquent\Model; |
| 8 | use Illuminate\Database\Eloquent\Relations\BelongsTo; |
| 9 | |
| 10 | /** |
| 11 | * @property integer $article_id |
| 12 | * @property integer $platform_channel_id |
| 13 | * @property integer $post_id |
| 14 | * |
| 15 | * @method static create(array<string, mixed> $array) |
| 16 | */ |
| 17 | class ArticlePublication extends Model |
| 18 | { |
| 19 | /** @use HasFactory<ArticlePublicationFactory> */ |
| 20 | use HasFactory; |
| 21 | |
| 22 | protected $fillable = [ |
| 23 | 'article_id', |
| 24 | 'platform_channel_id', |
| 25 | 'post_id', |
| 26 | 'published_at', |
| 27 | 'published_by', |
| 28 | 'platform', |
| 29 | 'publication_data', |
| 30 | ]; |
| 31 | |
| 32 | protected $casts = [ |
| 33 | 'published_at' => 'datetime', |
| 34 | 'publication_data' => 'array', |
| 35 | ]; |
| 36 | |
| 37 | /** |
| 38 | * @return BelongsTo<Article, $this> |
| 39 | */ |
| 40 | public function article(): BelongsTo |
| 41 | { |
| 42 | return $this->belongsTo(Article::class); |
| 43 | } |
| 44 | } |