Skip to content

Instantly share code, notes, and snippets.

@dannewns
Created November 19, 2014 12:46
Show Gist options
  • Save dannewns/a823b72a61f315710844 to your computer and use it in GitHub Desktop.
Save dannewns/a823b72a61f315710844 to your computer and use it in GitHub Desktop.
Repository Version
Route::get('{something}/csv', ['uses' => 'SomeController@getCSV', 'as' => 'csv.get']);
SomeController {
public function getCSV($something)
{
$csv = $this->csv_repository->find($something);
}
CsvRepository Implements CsvRepositoryInterface {
public function __construct(\Client\CSV\Standard $standard,
\Client\CSV\Wokingham $wokingham,
\Client\CSV\Flagship $flagship,
\Client\CSV\Keystone $keystone
)
{
$this->standard = $standard;
$this->wokingham = $wokingham;
$this->flagship = $flagship;
$this->keystone = $keystone;
}
switch($value) {
case '161': // Wokingham
return $this->wokingham->find($value);
break;
case '81': // Friendship Care and Housing
case '267': // Worcester Community Housing
case '38': // Clwyd Alyn Housing Association
case '172': // Spire Homes
case '205': // Two Rivers Housing
case '128': // South Shropshire Housing Association (http://isite.dmwsafety.co.uk/client?q=shropshire ??)
case '82': // Festival Housing
case '273': // Herefordshire Housing
case '214': // Beechdale Community Housing
case '132': // Soha Housing Ltd
case '130': // Solihull Community Housing
case '170': // Orbit Heart Of England
case '171': // Orbit South & East (http://isite.dmwsafety.co.uk/client?q=Orbit ??)
return $this->flagship->find($value);
break;
case '175': // Sanctuary Housing
case '168': // Lovell - Stroud
case '180': // Lovell Respond
case '215': // Glevum Heating
case '210': // Mears Group Plc / Stroud
return $this->keystone->find($value);
break;
case '177': // Wolverhampton Homes
case '277': // Wates
case '169': // Bullock
default:
return $this->standard->find($value);
break;
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment