Read.php 506 B

123456789101112131415161718192021
  1. <?php
  2. namespace App\Models\Wetalk;
  3. use Illuminate\Database\Eloquent\Model;
  4. use DateTimeInterface;
  5. class Read extends Model
  6. {
  7. protected $connection = 'mysql_t';
  8. protected $table='read';
  9. protected $guarded=[];
  10. protected function serializeDate(DateTimeInterface $date): string
  11. {
  12. return $date->format('Y-m-d H:i:s');
  13. }
  14. public function article(): \Illuminate\Database\Eloquent\Relations\HasOne
  15. {
  16. return $this->hasOne(Article::class,'id','article_id');
  17. }
  18. }