37 lines
748 B
PHP
37 lines
748 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class PostSection extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'post_sections';
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*
|
|
* @var list<string>
|
|
*/
|
|
protected $fillable = [
|
|
'post_id',
|
|
'label',
|
|
'position',
|
|
'content',
|
|
];
|
|
|
|
/**
|
|
* Get the post associated with the post section.
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Post, $this>
|
|
*/
|
|
public function post(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Post::class);
|
|
}
|
|
}
|