From 02a23224805c06697b4f61dd2cb8bbde1ec10438 Mon Sep 17 00:00:00 2001 From: Erjan Date: Fri, 18 May 2018 17:27:40 +0300 Subject: [PATCH] Patch debug mode only (#3) --- src/Controllers/LiveTinkerController.php | 7 ------- src/LiveTinkerServiceProvider.php | 6 ++++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/Controllers/LiveTinkerController.php b/src/Controllers/LiveTinkerController.php index fd4c26c..3e081d6 100644 --- a/src/Controllers/LiveTinkerController.php +++ b/src/Controllers/LiveTinkerController.php @@ -8,13 +8,6 @@ class LiveTinkerController extends Controller { - public function __construct() - { - if (! env('APP_DEBUG')) { - abort(403); - }; - } - public function index() { return view('live-tinker::index'); diff --git a/src/LiveTinkerServiceProvider.php b/src/LiveTinkerServiceProvider.php index 983e098..e797737 100644 --- a/src/LiveTinkerServiceProvider.php +++ b/src/LiveTinkerServiceProvider.php @@ -30,7 +30,9 @@ public function boot() public function register() { - include __DIR__.'/routes.php'; - $this->app->make('Erjanmx\LiveTinker\Controllers\LiveTinkerController'); + if (env('APP_DEBUG')) { + include __DIR__.'/routes.php'; + $this->app->make('Erjanmx\LiveTinker\Controllers\LiveTinkerController'); + }; } }