FEATURE: prevent running some service providers in artisan

This commit is contained in:
Michal Kváček
2016-03-22 16:02:08 +01:00
parent 98090f69df
commit 28c065e106
3 changed files with 18 additions and 3 deletions
+6
View File
@@ -3,6 +3,7 @@
namespace App\Providers;
use App\Models\Settings;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
@@ -15,6 +16,11 @@ class GlobalViewDataProvider extends ServiceProvider
*/
public function boot()
{
// ignore running from artisan
if (App::runningInConsole()) {
return;
}
$settings = new Settings();
foreach ($settings->getForView() as $key => $value) {