Config.php 783 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App\Models\Member;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. use Illuminate\Database\Eloquent\Model;
  5. use Illuminate\Foundation\Auth\User as Authenticatable;
  6. use Illuminate\Notifications\Notifiable;
  7. use Laravel\Sanctum\HasApiTokens;
  8. use Spatie\Permission\Traits\HasRoles;
  9. class Config extends Model
  10. {
  11. use HasFactory;
  12. protected $table = 'member_config';
  13. /**
  14. * The attributes that are mass assignable.
  15. *
  16. * @var array<int, string>
  17. */
  18. protected $fillable = [];
  19. protected $guarded = [];
  20. protected $casts = [
  21. 'pointTradeDeductEnable' => 'bool'
  22. ];
  23. public function setPointTradeDeductEnableAttribute($value)
  24. {
  25. $this->attributes['point_trade_deduct_enable'] = $value ? 1 : 0;
  26. }
  27. }