Files
monica/app/Models/PostSection.php
T

35 lines
652 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 array<string>
*/
protected $fillable = [
'post_id',
'label',
'position',
'content',
];
/**
* Get the post associated with the post section.
*/
public function post(): BelongsTo
{
return $this->belongsTo(Post::class);
}
}