Cleaned up select box stuff, moved to repositories

This commit is contained in:
Nabeel Shahzad
2017-12-01 11:11:03 -06:00
parent 9706114289
commit 9566da84a5
7 changed files with 108 additions and 75 deletions

View File

@@ -20,4 +20,19 @@ class AirportRepository extends BaseRepository implements CacheableInterface
{
return Airport::class;
}
/**
* Return the list of airports formatted for a select box
* @return array
*/
public function selectBoxList()
{
$retval = [];
$items = $this->all();
foreach ($items as $i) {
$retval[$i->icao] = $i->icao . ' - ' . $i->name;
}
return $retval;
}
}