Laravel task scheduling pusher practice summary (basic configuration)

First of all, I register my account on pusher’s official website and choose the operation service, because I’m used to using Vue, but I choose JS without a front end. Of course, the back end is laravel

Then go to packagyst to download and configure pusher…

$ composer require pusher/pusher-http-laravel

config/app.php to your aliases

'Pusher' => Pusher\Laravel\Facades\Pusher::class

config/app.php in the providers


Then the pusher file will appear under the config file

Specific configuration

    'connections' => [

        'main' => [
            'auth_key' => env('PUSHER_APP_KEY'),
            'secret' => env('PUSHER_APP_SECRET'),
            'app_id' => env('PUSHER_APP_ID'),
            'options' => [
                'cluster' => 'ap1',
                'encrypted' => true
            'host' => null,
            'port' => null,
            'timeout' => null,

        'alternative' => [
            'auth_key' => 'your-auth-key',
            'secret' => 'your-secret',
            'app_id' => 'your-app-id',
            'options' => [],
            'host' => null,
            'port' => null,
            'timeout' => null,



Because I wrote the key configuration registered from pusher in Env, you can also write it directly
Env configuration


This completes the basic configuration
De route activate it

Route::get('pusher/index','[email protected]');

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class PusherController extends Controller
    function index(){
        return view('pusher/index');

In this way, monitoring information will appear every time you access the address official website on the route

Basic configuration has ended

Recommended Today

Compile and install redis6.0.5

First, install the gcc package yum install cpp yum install binutils yum install glibc yum install glibc-kernheaders yum install glibc-common yum install glibc-devel yum install gcc yum install make Second, upgrade gcc yum -y install centos-release-scl yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils scl enable devtoolset-9 bash 3. Download and install redis wget tar -xzvf […]