Chat.php 867 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Builder;
  4. use Illuminate\Foundation\Auth\User as Authenticatable;
  5. use Illuminate\Notifications\Notifiable;
  6. use Laravel\Sanctum\HasApiTokens;
  7. /**
  8. * @mixin Builder
  9. * @method static Builder|static where($column, $operator = null, $value = null, $boolean = 'and')
  10. */
  11. class Chat extends Authenticatable
  12. {
  13. use HasApiTokens, Notifiable;
  14. protected $table = 'chats';
  15. protected $hidden = ['created_at', 'updated_at'];
  16. protected $fillable = ['title', 'chat_id'];
  17. protected function getCreatedAtAttribute($value)
  18. {
  19. return \Carbon\Carbon::parse($value)->setTimezone('Asia/Shanghai')->format('Y-m-d H:i:s');
  20. }
  21. protected function getUpdatedAtAttribute($value)
  22. {
  23. return \Carbon\Carbon::parse($value)->setTimezone('Asia/Shanghai')->format('Y-m-d H:i:s');
  24. }
  25. }