GameplayRule.php 837 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 GameplayRule extends Authenticatable
  12. {
  13. use HasApiTokens, Notifiable;
  14. protected $table = 'gameplay_rules';
  15. protected $hidden = ['created_at', 'updated_at'];
  16. protected function getCreatedAtAttribute($value)
  17. {
  18. return \Carbon\Carbon::parse($value)->setTimezone('Asia/Shanghai')->format('Y-m-d H:i:s');
  19. }
  20. protected function getUpdatedAtAttribute($value)
  21. {
  22. return \Carbon\Carbon::parse($value)->setTimezone('Asia/Shanghai')->format('Y-m-d H:i:s');
  23. }
  24. }