4 lines
352 B
PHP
4 lines
352 B
PHP
<?php
|
|
namespace App\Enums;
|
|
enum KeywordDevice:string { case Desktop='desktop'; case Mobile='mobile'; public function label():string{return match($this){self::Desktop=>__('states.desktop'),self::Mobile=>__('states.mobile')};} public static function options():array{return collect(self::cases())->mapWithKeys(fn($v)=>[$v->value=>$v->label()])->all();} }
|