GameplayRule.php 964 B

123456789101112131415161718192021222324252627282930313233343536373839
  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 $fillable = [
  17. 'keywords',
  18. 'groups',
  19. 'maxinum',
  20. 'mininum',
  21. 'odds',
  22. ];
  23. protected function getCreatedAtAttribute($value)
  24. {
  25. return \Carbon\Carbon::parse($value)->setTimezone('Asia/Shanghai')->format('Y-m-d H:i:s');
  26. }
  27. protected function getUpdatedAtAttribute($value)
  28. {
  29. return \Carbon\Carbon::parse($value)->setTimezone('Asia/Shanghai')->format('Y-m-d H:i:s');
  30. }
  31. }