領収証発行サービス
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.

33 lines
655B

  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 ($uuid) {
  21. $this->id = $uuid;
  22. } else {
  23. $this->id = Str::uuid();
  24. }
  25. }
  26. }