Skip to content

Instantly share code, notes, and snippets.

@kareypowell
Created July 5, 2016 02:04
Show Gist options
  • Save kareypowell/1855bcfd5f6d15a4ea16738db75dd977 to your computer and use it in GitHub Desktop.
Save kareypowell/1855bcfd5f6d15a4ea16738db75dd977 to your computer and use it in GitHub Desktop.
App::singleton('tenant', function($app) {
$server = explode('.', Request::getHost());
if (count($server) === 3 && $server[0] !== 'www') {
$organization = Organization::where('slug', $server[0])->firstOrFail();
return $organization;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment