Add branch & province model
This commit is contained in:
73
app/Repos/System/Settings/Location/RegionRepo.php
Normal file
73
app/Repos/System/Settings/Location/RegionRepo.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repos\System\Settings\Location;
|
||||
|
||||
class RegionRepo
|
||||
{
|
||||
/**
|
||||
* Mary
|
||||
*/
|
||||
public const MR = 'mr';
|
||||
|
||||
/**
|
||||
* Aşgabat
|
||||
*/
|
||||
public const AG = 'ag';
|
||||
|
||||
/**
|
||||
* Arkadag
|
||||
*/
|
||||
public const AK = 'ak';
|
||||
|
||||
/**
|
||||
* Ahal
|
||||
*/
|
||||
public const AH = 'ah';
|
||||
|
||||
/**
|
||||
* Lebap
|
||||
*/
|
||||
public const LB = 'lb';
|
||||
|
||||
/**
|
||||
* Balkan
|
||||
*/
|
||||
public const BN = 'bn';
|
||||
|
||||
/**
|
||||
* Daşoguz
|
||||
*/
|
||||
public const DZ = 'dz';
|
||||
|
||||
/**
|
||||
* Regions
|
||||
*/
|
||||
public static function values(): array
|
||||
{
|
||||
return [
|
||||
self::AG => __('Ashgabat'),
|
||||
self::AK => __('Arkadag'),
|
||||
self::MR => __('Mary'),
|
||||
self::AH => __('Ahal'),
|
||||
self::LB => __('Lebap'),
|
||||
self::BN => __('Balkan'),
|
||||
self::DZ => __('Dashoguz'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Default region
|
||||
*/
|
||||
public static function default(): string
|
||||
{
|
||||
return self::AG;
|
||||
}
|
||||
|
||||
/**
|
||||
* Label for given region
|
||||
*/
|
||||
public static function label(string $region = 'ag'): string
|
||||
{
|
||||
return static::values()[$region] ?? '';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user