Authors.php
9 months ago
Categories.php
9 months ago
Countries.php
6 months ago
DeviceBrowsers.php
9 months ago
DeviceOperatingSystems.php
9 months ago
DeviceTypes.php
9 months ago
FormConversions.php
6 months ago
LinkPatternConversions.php
6 months ago
LinkPatterns.php
9 months ago
PageTypes.php
9 months ago
ReferrerTypes.php
9 months ago
Countries.php
20 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP\ColumnOptions\Plugins; |
| 4 | |
| 5 | use IAWP\ColumnOptions\Option; |
| 6 | use IAWP\ColumnOptions\OptionsPlugin; |
| 7 | use IAWP\Illuminate_Builder; |
| 8 | use IAWP\Tables; |
| 9 | /** @internal */ |
| 10 | class Countries implements OptionsPlugin |
| 11 | { |
| 12 | public function get_options() : array |
| 13 | { |
| 14 | $records = Illuminate_Builder::new()->from(Tables::countries())->select('country_id', 'country')->get()->all(); |
| 15 | return \array_map(function ($record) { |
| 16 | return new Option($record->country_id, $record->country); |
| 17 | }, $records); |
| 18 | } |
| 19 | } |
| 20 |