43 lines
841 B
PHP
43 lines
841 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Inhaltsverzeichnis extends Model
|
|
{
|
|
protected $fillable = [
|
|
'name',
|
|
'ueberschrift_verbergen',
|
|
'inhaltselement_id',
|
|
'textblock_id',
|
|
'sort',
|
|
'ordnungszahl',
|
|
'seite',
|
|
'neue_seite',
|
|
'seitenzahl_anzeige',
|
|
];
|
|
|
|
/**
|
|
* Get the attributes that should be cast.
|
|
*
|
|
* @return array<string, string>
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'seitenzahl_anzeige' => 'boolean',
|
|
];
|
|
}
|
|
|
|
public function textblock()
|
|
{
|
|
return $this->hasMany(Textblock::class, 'id', 'textblock_id');
|
|
}
|
|
|
|
public function inhaltselement()
|
|
{
|
|
return $this->hasMany(Inhaltselement::class, 'id', 'inhaltselement_id');
|
|
}
|
|
}
|