PHP code example of launcher / mercurius

1. Go to this page and download the library: Download launcher/mercurius library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

launcher / mercurius example snippets


...
BROADCAST_DRIVER=pusher
...
PUSHER_APP_ID="xxxxxx"
PUSHER_APP_KEY="xxxxxxxxxxxxxxxxxxxx"
PUSHER_APP_SECRET="xxxxxxxxxxxxxxxxxxxx"
PUSHER_APP_CLUSTER="xx"

return [

    /*
    |--------------------------------------------------------------------------
    | Mercurius Models
    |--------------------------------------------------------------------------
    |
    | Defines the models used with Mercurius, use it to extend Mercurius and
    | create your own implementation.
    |
    */

    'models' => [
        'user' => App\User::class,
        'messages' => Launcher\Mercurius\Models\Message::class,
    ],

    /*
    |--------------------------------------------------------------------------
    | User Table Fields
    |--------------------------------------------------------------------------
    |
    | You can specify the column names for the user table. The `name` accepts
    | an array of fields, for building custom names with multiple columns.
    |
    */

    'fields' => [
        // 'name'   => ['first_name', 'last_name'],
        'name'   => 'name',
        'slug'   => 'slug',
        'avatar' => 'avatar',
    ],
];

// ...
use Illuminate\Foundation\Auth\User as Authenticatable;
use Launcher\Mercurius\MercuriusUser;

class User extends Authenticatable
{
    use MercuriusUser;
    // ...
}

php artisan vendor:publish --tag=mercurius-public --force
bash
php artisan make:auth
bash
php artisan vendor:publish --tag=mercurius-config
bash
php artisan mercurius:install
composer dump-autoload
bash
php artisan db:seed --class=MercuriusDatabaseSeeder