Skip to content

Instantly share code, notes, and snippets.

@sdwru
sdwru / Laravel-websockets-on-Laravel-API-backend+Laravel-Echo-on-Vue.js-front-end-on-different-server-domain-using-private-channel.md
Last active February 22, 2024 16:11
Laravel-websockets on Laravel API backend + Laravel Echo on Vue.js front end on different server/domain using private channel.md

These are my notes on how I got all the basics working end to end.

Laravel API backend and Vue.js frontend are 2 different servers on different public IP addresses and different domains. I am using pure Vue.js on the front end. Most instructions assume Laravel Vue.js is being used which is structured slightly different with different file names and directories.

  • Laravel API backend domain name (api.somedomain.com)
  • Vue.js frontend domain name (client.somedomain.com)

No database is needed for any of this to work using sync queue. That is only needed in production if/when you use a database queue.


Combine multiple ajax permission calls into one.

Depending on how larger your tables are, and how large the latency between you and the server, the UI speed increases can be quite dramatic.

Add the following function to astpp/assets/js/module_js/generate_grid.js around line 360

function build_buttons_multi(buttons_arr) {
    var jsonObj = []; //declare object
    if (buttons_arr == "") {
        return jsonObj;
@sdwru
sdwru / CustomWebsocketOneController.php
Created October 18, 2021 17:24 — forked from rahulhaque/CustomWebsocketOneController.php
Ratchet Websocket Server Routing Example Laravel
<?php
namespace App\Http\Controllers;
use Ratchet\ConnectionInterface;
use Ratchet\WebSocket\MessageComponentInterface;
use React\EventLoop\LoopInterface;
use SplObjectStorage;
class CustomWebsocketOneController implements MessageComponentInterface
@sdwru
sdwru / 1_google_cloud_storage_backup_tutorial.md
Created August 26, 2020 19:18 — forked from rnwolf/1_google_cloud_storage_backup_tutorial.md
Tutorial shows how to make backups to Google Cloud Storage.

Google Cloud Storage backup tutorial

Introduction

This tutorial shows how to make backups to Google Cloud Storage. The backups are:

  • automatic
  • stored off site
  • incremental

Pretending to be the non-free billing app

FusionPBX doesn't do billing or LCR out of the box, but one guy will sell you closed, proprietary, non-free billing and LCR modules that will integrate nicely into FusionPBX. To help with this, there are a number of places in the free FusionPBX codebase that run things that these non-free apps need. Obviously these are all completely undocumented, until now.

These work by checking for an app named "billing". Specifically, they look for the app_config.php file in the billing folder. The conditional usually looks like this: