Created
June 3, 2017 19:12
-
-
Save aguimaraes/01201ba00e3e4c05d59062fc1bd8ce63 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Illuminate\Database\Eloquent\Model; | |
class FeatureToggle extends Model | |
{ | |
public $timestamps = true; | |
public function getCurrentToggleConfig(): FeatureToggle | |
{ | |
return $this->firstOrNew(); | |
} | |
public function isFraudDetectionEnabled(): bool | |
{ | |
return (bool)$this->getCurrentToggleConfig()->fraud_detection ?? false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment