AspireCloud/app/Models/BaseModel.php
Chuck Adams 35482eb543
First Party Publishing MVP: seed AspireUpdate plugin (#134)
* fix: use elvis to defensively cast falsy columns to null

* feat: use PluginProps dataclass to validate Plugin::create()

* feat: add ThemeProps and use them in Theme::create

* feat: add validations to PluginProps/ThemeProps

* feat: Repo abstraction over sources (not to be confused with Model/Entity Repositories)

* feat: seed AspireUpdate plugin.  We are now first-party.

---------

Signed-off-by: Chuck Adams <cja987@gmail.com>
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
2025-01-19 08:02:03 -07:00

22 lines
500 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
abstract class BaseModel extends Model
{
// use HasUuids; // can't be undone, so it's better to define on each subclass
public $timestamps = false;
protected $guarded = []; // everything is fillable by default
/**
* @param array<string, mixed> $attributes
*/
protected static function _create(array $attributes = []): static
{
return static::query()->create($attributes);
}
}