|
- <?php
-
- namespace App\Models;
-
- use Illuminate\Database\Eloquent\Concerns\HasUuids;
- use Illuminate\Database\Eloquent\SoftDeletes;
- use Illuminate\Support\Str;
-
- abstract class AppModel extends BaseModel
- {
- use SoftDeletes, HasUuids;
-
- public function getHistory(): ?HistoryModel
- {
- $historyName = static::class . 'History';
- return new $historyName;
- }
-
- public function getChangeLogMessage($before, $after): ?string
- {
- return null;
- }
-
- public function setId(?string $uuid = null)
- {
- if ($uuid) {
- $this->id = $uuid;
- } else {
- $this->id = Str::uuid();
- }
- }
- }
|