add element persistence
This commit is contained in:
parent
aaab0e5379
commit
fcc6ade8f3
7 changed files with 289 additions and 0 deletions
47
backend/app/Element/ElementModel.php
Normal file
47
backend/app/Element/ElementModel.php
Normal 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',
|
||||
];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue