2022-06-27 01:39:01 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Filament;
|
|
|
|
|
|
2022-06-29 17:00:15 +08:00
|
|
|
trait OptionsTrait
|
2022-06-27 01:39:01 +08:00
|
|
|
{
|
|
|
|
|
private static array $matchTypes = ['dec' => 'dec', 'hex' => 'hex'];
|
|
|
|
|
|
|
|
|
|
private static array $yesOrNo = ['yes' => 'yes', 'no' => 'no'];
|
2022-07-02 15:08:23 +08:00
|
|
|
|
|
|
|
|
private static function getEnableDisableOptions($enableValue = 0, $disableValue = 1): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
$enableValue => __('label.enabled'),
|
|
|
|
|
$disableValue => __('label.disabled'),
|
|
|
|
|
];
|
|
|
|
|
}
|
2022-10-02 21:14:11 +08:00
|
|
|
|
|
|
|
|
private static function getYesNoOptions($yesValue = 1, $noValue = 0): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
$yesValue => 'Yes',
|
|
|
|
|
$noValue => 'No',
|
|
|
|
|
];
|
|
|
|
|
}
|
2022-06-27 01:39:01 +08:00
|
|
|
}
|