More fixes

This commit is contained in:
Graham Campbell
2016-02-02 20:46:46 +00:00
parent 4923a59b76
commit 921116a198
5 changed files with 51 additions and 25 deletions

View File

@@ -28,6 +28,8 @@ class Admin
* Create a new admin middleware instance.
*
* @param \Illuminate\Contracts\Auth\Guard $auth
*
* @return void
*/
public function __construct(Guard $auth)
{

View File

@@ -12,9 +12,29 @@
namespace CachetHQ\Cachet\Http\Middleware;
use Closure;
use Illuminate\Contracts\Config\Repository;
class Timezone
{
/**
* Config repository.
*
* @var \Illuminate\Contracts\Config\Repository
*/
protected $config;
/**
* Creates a new release instance.
*
* @param \Illuminate\Contracts\Config\Repository $config
*
* @return void
*/
public function __construct(Repository $config)
{
$this->config = $config;
}
/**
* Handle an incoming request.
*
@@ -26,7 +46,7 @@ class Timezone
public function handle($request, Closure $next)
{
if ($tz = $request->header('Time-Zone')) {
app('config')->set('cachet.timezone', $tz);
$this->config->set('cachet.timezone', $tz);
}
return $next($request);