Files
monica/app/Models/PostSection.php
T
2025-01-29 10:47:16 +01:00

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);
}
}