2017-07-12 24 views

उत्तर

1

(ओपी प्रश्न में निम्नलिखित उत्तर पोस्ट अंतर्निहित मुद्दा यह है कि pusher-php-server का संस्करण 3 एक नाम स्थान का परिचय और तो अब use Pusher\Pusher की आवश्यकता है।।)

इस आदेश बनाएं:

namespace App\Console\Commands; 

use Illuminate\Support\Facades\File; 
use Illuminate\Console\Command; 

class FixPusher extends Command 
{ 

    /** 
    * The name and signature of the console command. 
    * 
    * @var string 
    */ 
    protected $signature = 'fix:pusher'; 

    /** 
    * The console command description. 
    * 
    * @var string 
    */ 
    protected $description = 'Fix Pusher namespace issue'; 

    /** 
    * Create a new command instance. 
    * 
    * @return void 
    */ 
    public function __construct() 
    { 
     parent::__construct(); 
    } 

    /** 
    * Execute the console command. 
    * 
    * @return mixed 
    */ 
    public function handle() 
    { 
     $broadcastManagerPath = base_path('vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastManager.php'); 
     $pusherBroadcasterPath = base_path('vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php'); 

     $contents = str_replace('use Pusher;', 'use Pusher\Pusher;', File::get($broadcastManagerPath)); 
     File::put($broadcastManagerPath, $contents); 

     $contents = str_replace('use Pusher;', 'use Pusher\Pusher;', File::get($pusherBroadcasterPath)); 
     File::put($pusherBroadcasterPath, $contents); 
    } 
} 

फिर जोड़ने

"post-update-cmd": [ 
    "php artisan fix:pusher", 
    "Illuminate\\Foundation\\ComposerScripts::postUpdate", 
    "php artisan optimize" 
] 
0

पुशर का संस्करण 3 मैं r के साथ: "php artisan fix:pusher"composer.json फाइल करने के लिए eusized कि पुशर \ पुशर के लिए नामस्थान बदल दिया गया है। यदि संगीतकार द्वारा कॉन्फ़िगर किया गया है तो इसे .env, BROADCAST_DRIVER = पुशर सेट करें, यह त्रुटि दिखा रहा है। लॉग की जांच कर रहा है, तो आप पता कर सकते हैं जहां समस्याओं, इस फाइल पर स्थित है:

'विक्रेता/laravel/रूपरेखा/src/रोशन/प्रसारण/BroadcastManager.php "

। यह आवश्यक परिवर्तन छवि की तरह पुशर के बजाय पुशर \ पुशर के लिए संदर्भ है: enter image description here

तो समारोह PusherBroadCaster पता लगाना और पुशर के लिए संदर्भ पुशर बदल \ पुशर।

enter image description here

विक्रेता/laravel/रूपरेखा/src/रोशन/प्रसारण/प्रसारकों/PusherBroadcaster.php

18

क्लाउडियो के निदान सही है, तो नाम स्थान पुशर संस्करण 3 गया; लेकिन लार्वा फाइलों को बदलना एक अनुशंसित समाधान नहीं है।

config/app.php में उपनाम बनाने का एक बेहतर तरीका है। 'उपनाम' कुंजी के तहत, इसे "थर्ड पार्टी एलियंस" अनुभाग में सरणी में जोड़ें:

'Pusher' => Pusher\Pusher::class, 
संबंधित मुद्दे