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,20 @@ class AirlineRepository extends BaseRepository implements CacheableInterface
{
return Airline::class;
}
/**
* Return the list of airline formatted for a select box
* @return array
*/
public function selectBoxList()
{
$retval = [];
$items = $this->all();
foreach ($items as $i) {
$retval[$i->id] = $i->name;
}
return $retval;
}
}