add element persistence

This commit is contained in:
Yisroel Baum 2026-08-08 22:21:25 +03:00
parent aaab0e5379
commit fcc6ade8f3
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
7 changed files with 289 additions and 0 deletions

View file

@ -0,0 +1,47 @@
<?php
namespace App\Element;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
/**
* @property int $id
* @property int $set_id
* @property string $name
* @property string $kind
* @property int|null $parent_element_id
* @property int $position
*
* @method static Builder<static>|ElementModel newModelQuery()
* @method static Builder<static>|ElementModel newQuery()
* @method static Builder<static>|ElementModel query()
*
* @mixin \Eloquent
*/
#[Fillable([
'set_id',
'name',
'kind',
'parent_element_id',
'position',
])]
class ElementModel extends Model
{
protected $table = 'elements';
public $timestamps = false;
/**
* @return array<string, string>
*/
protected function casts(): array
{
return [
'set_id' => 'integer',
'parent_element_id' => 'integer',
'position' => 'integer',
];
}
}