領収証発行サービス
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
696B

  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Concerns\HasUuids;
  4. use Illuminate\Database\Eloquent\SoftDeletes;
  5. use Illuminate\Support\Str;
  6. abstract class AppModel extends BaseModel
  7. {
  8. use SoftDeletes, HasUuids;
  9. public function getHistory(): ?HistoryModel
  10. {
  11. $historyName = static::class . 'History';
  12. return new $historyName;
  13. }
  14. public function getChangeLogMessage($before, $after): ?string
  15. {
  16. return null;
  17. }
  18. public function setId(?string $uuid = null)
  19. {
  20. if ($this->id !== null) return;
  21. if ($uuid) {
  22. $this->id = $uuid;
  23. } else {
  24. $this->id = Str::uuid();
  25. }
  26. }
  27. }