SignRecord.php 721 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App\Models;
  3. use DateTimeInterface;
  4. use Illuminate\Database\Eloquent\Factories\HasFactory;
  5. use Illuminate\Database\Eloquent\Model;
  6. /**
  7. * App\Models\Contract
  8. *
  9. * @mixin \Eloquent
  10. */
  11. class SignRecord extends Model
  12. {
  13. use HasFactory;
  14. protected $guarded = ['id', 'updated_at', 'created_at'];
  15. /**
  16. * The table associated with the model.
  17. *
  18. * @var string
  19. */
  20. protected $table = 'sign_records';
  21. /**
  22. * 为数组 / JSON 序列化准备日期。
  23. *
  24. * @param \DateTimeInterface $date
  25. * @return string
  26. */
  27. protected function serializeDate(DateTimeInterface $date)
  28. {
  29. return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
  30. }
  31. }