35 lines
789 B
PHP
35 lines
789 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
class Article extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
/** The name of the database table storing this Model's records. */
|
|
protected $table = 'articles';
|
|
|
|
/** The attributes on the Model that can be mass-assigned */
|
|
protected $fillable = [
|
|
'title',
|
|
'subtitle',
|
|
'author_id',
|
|
'slug',
|
|
'body',
|
|
'published_at',
|
|
'header_image_url',
|
|
'path_to_markdown_source',
|
|
'processed_at',
|
|
];
|
|
|
|
/** The person that wrote the article. */
|
|
public function author(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Author::class);
|
|
}
|
|
}
|