PHP code example of blax-software / laravel-websockets
1. Go to this page and download the library: Download blax-software/laravel-websockets 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/ */
blax-software / laravel-websockets example snippets
use BlaxSoftware\LaravelWebSockets\Attributes\Websocket;
class FlightschoolController extends Controller
{
#[Websocket] // event: "flightschool.index"
public function index() { ... }
#[Websocket(event: 'flightschools.list')] // explicit override
public function list() { ... }
#[Websocket(needAuth: true)] //