| 12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- namespace App\Models;
- use DateTimeInterface;
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use Illuminate\Database\Eloquent\Model;
- /**
- * App\Models\Contract
- *
- * @mixin \Eloquent
- */
- class Contract extends Model
- {
- use HasFactory;
- protected $guarded = ['id', 'updated_at', 'created_at'];
- /**
- * The table associated with the model.
- *
- * @var string
- */
- protected $table = 'contracts';
- /**
- * 为数组 / JSON 序列化准备日期。
- *
- * @param \DateTimeInterface $date
- * @return string
- */
- protected function serializeDate(DateTimeInterface $date)
- {
- return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
- }
- }
|