Created
February 7, 2015 07:28
-
-
Save szainmehdi/fdf3cbf9822cb7c5c201 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use App\Cache\Cache; | |
class WhateverController { | |
/** @var \App\Cache\Cache $cache */ | |
private $cache; | |
public function __construct(Cache $cache) { | |
$this->cache = $cache; | |
} | |
public function index() { | |
if($this->isInMaintenanceMode()) { | |
return Response::view('mainteance', [], 503); | |
} | |
} | |
private function isInMaintenanceMode() { | |
return $this->cache->getSetting()->mainteance_mode === 1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment