ldc-doux/app/Models/Text.php

46 lines
784 B
PHP
Raw Normal View History

2021-12-15 10:09:39 +01:00
<?php
namespace App\Models;
use App\Enums\Page;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
2022-08-29 17:23:10 +02:00
use Kwaadpepper\Enum\Traits\CastsEnums;
use Spatie\Translatable\HasTranslations;
2021-12-15 10:09:39 +01:00
class Text extends Model
{
use HasFactory;
2022-08-29 17:23:10 +02:00
use CastsEnums;
use HasTranslations;
2021-12-15 10:09:39 +01:00
2022-08-29 17:23:10 +02:00
/**
* Map attribute names to enum classes.
*
* @var array
*/
2021-12-15 10:09:39 +01:00
public $enumCasts = [
'page' => Page::class
];
2022-08-29 17:23:10 +02:00
/**
* The attributes that are mass assignable.
*
* @var array
*/
2021-12-15 10:09:39 +01:00
protected $fillable = [
'title',
'text',
];
2022-01-23 12:38:29 +01:00
2022-08-29 17:23:10 +02:00
/**
* The attributes that are translatable.
*
* @var array
*/
2022-01-23 12:38:29 +01:00
public $translatable = [
'title',
'text',
];
2021-12-15 10:09:39 +01:00
}