Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can I use laravel echo without laravel framework and npm

Is any way to use Laravel-echo library without Laravel framework and NPM? just use <script> tag and add library to my project.

like image 755
Mohammad Chavoshi Avatar asked Dec 02 '16 20:12

Mohammad Chavoshi


Video Answer


1 Answers

You can use the echojs without laravel and npm.

echojs is a Js library,

Follow these steps to create echo.js file:

import Echo from "laravel-echo"
window.Echo = Echo; // inject the echo js into the browser

compile this with gulp using following code

const elixir = require('laravel-elixir');

elixir(mix => {
    mix
       .webpack('echo.js','public/assets/js/echo.js');
});

You can use this public/assets/js/echo.js file in any projects.

If you're not comfortable with above steps, go to our repository https://github.com/W2S-Solutions/laravel-echo-js-compiled/ and copy echo.js to use anywhere in your project

like image 157
W2S Solutions Avatar answered Sep 30 '22 02:09

W2S Solutions