Step by Step Guide to Installing Socket.io and Broadcasting Events with Laravel 5.1.pdf - Step by Step Guide to Installing Socket.io and Broadcasting

Step by Step Guide to Installing Socket.io and Broadcasting Events with Laravel 5.1.pdf

This preview shows page 1 - 4 out of 41 pages.

3/11/2019 Step by Step Guide to Installing Socket.io and Broadcasting Events with Laravel 5.1 1/41 mstnorris GENERAL Step by Step Guide to Installing Socket.io and Broadcasting Events with Laravel 5.1 Posted 3 years ago by mstnorris I've decided to put together a guide to help others in setting up socket.io within their projects. I hope you ±nd this resource useful. A big big shout out goes to @toniperic for helping me get socket.io up and running. You can view the original article where I got some of the information from; this guide builds upon it drastically, ±lls in the gaps, and is brought it up to date. Please excuse any mistakes in this walkthrough, the Markdown wasn't being parsed correctly while I wrote it. I will edit it in situ within the Laracasts Forum when I spot errors. If you feel I should elaborate anywhere or amend anything please let me know below. ~~At the time of writing this (3 Jun 2015) Laravel 5.1 hasn't been released. It is due for release on 9 Jun 2015 so it certainly isn't long to go. I thought I'd get a head start on the game and put together this guide from di²erent sources I found online.~~ In this walkthrough I'll assume you're using Laravel Homestead . Prerequisites Laravel Homestead already includes Node and Redis but just to check that they are installed and working correctly. 1. SSH into your Homestead VM 2. run node -v You will see something like "v0.10.33" 3. run redis-cli ping You should see "PONG" Create a New Project 1. You will need to get the latest version of Laravel and depending on when you read this you will have to do one of the follow. Using composer like so:
Image of page 1

Subscribe to view the full document.

3/11/2019 Step by Step Guide to Installing Socket.io and Broadcasting Events with Laravel 5.1 2/41 composer create-project laravel/laravel your-project-name dev-develop (to get the very latest release [may be unstable]) composer create-project laravel/laravel your-project-name Or using the laravel new command: laravel new your-project-name 1. Edit your /etc/hosts ±le on your host OS. Add the line "192.168.10.10 your-project-name.app" 1. While SSH'd into Homestead run serve your-project-name.app /home/vagrant/Code/path/to/public/directory 80 1. Staying SSH'd into Homestead cd your-project-name Install packages 1. npm install express ioredis socket.io --save Your package.json ±le will look like { "private" : true , "devDependencies" : { "gulp" : "^3.8.8" , "laravel-elixir" : "*" }, "dependencies" : { "express" : "^4.12.4" , "ioredis" : "^1.4.0" , "redis" : "^0.12.1" , "socket.io" : "^1.3.5" } } 1. composer require predis/predis The require part of your composer.json ±le will look like "require" : { "laravel/framework" : "5.1.*" , "predis/predis" : "^1.1 @dev " }, Creating the Event
Image of page 2
3/11/2019 Step by Step Guide to Installing Socket.io and Broadcasting Events with Laravel 5.1
Image of page 3

Subscribe to view the full document.

Image of page 4
  • Spring '17
  • ALLY

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes