diff --git a/src/FacebookServiceProvider.php b/src/FacebookServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/FacebookServiceProvider.php
+++ b/src/FacebookServiceProvider.php
@@ -43,7 +43,7 @@ class FacebookServiceProvider extends ServiceProvider
     {
         $source = realpath(__DIR__.'/../config/facebook.php');
 
-        if (class_exists('Illuminate\Foundation\Application', false)) {
+        if (class_exists('Illuminate\Foundation\Application', false) && $app->runningInConsole()) {
             $this->publishes([$source => config_path('facebook.php')]);
         } elseif (class_exists('Laravel\Lumen\Application', false)) {
             $app->configure('facebook');
Added extra check before registering publish command