Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

TutsPlus.com:
How Laravel Broadcasting Works
May 07, 2018 @ 16:41:41

The TutsPlus.com site has a new tutorial posted for the Laravel users out there ]introducing you to the framework's broadcast functionality](https://code.tutsplus.com/tutorials/how-laravel-broadcasting-works--cms-30500). Broadcasting in Laravel provides a simple interface to sending notification (such as emails or even real-time push messages) via a standardized interface.

Today, we are going to explore the concept of broadcasting in the Laravel web framework. It allows you to send notifications to the client side when something happens on the server side. In this article, we are going to use the third-party Pusher library to send notifications to the client side.

If you have ever wanted to send notifications from the server to the client when something happens on a server in Laravel, you're looking for the broadcasting feature.

The article walks through the scenario first and covers the basic flow of websockets and how they'd be used for messaging. From there they start in on the code, looking at the broadcast configuration and walking you through the setup of a Pusher account and the installation of the SDK. They help you configure the Laravel application for Pusher and install the Laravel Echo library for handling the messaging on the frontend. The tutorial goes through the code to create a "messages" table and hook in a "broadcast on" event. This is followed by the frontend setup including the Javascript to create the Pusher instance.

tagged: laravel broadcast pusher tutorial event websocket

Link: https://code.tutsplus.com/tutorials/how-laravel-broadcasting-works--cms-30500

Adnan Sabanovic:
How to use Laravel with Socket.IO
Apr 09, 2018 @ 17:07:28

In a new post to his Medium.com site Adnan Sabanovic shows you how to combine Laravel and Socket.io to create in-application messaging.

Websockets are cool. They are really helpful if you want to show real time activities from your users (or perhaps some queue jobs). Now, if you are afraid of the word “Websockets”, don’t be. I will lay down the instructions on how you can use it and will be around to answer your questions if you need to.

I had this challenge where I needed it to show a list of people who are currently viewing a specific URL in Laravel. So I started thinking. Part of me wanted to do a quick hack (luckily that’s not the strongest side of mine), whilst the other wanted to build something cool, reusable and long-lasting.

While many recommend using the Pusher service, there's a way to replicate it locally using Socket.io and the Laravel Echo Server. He walks you through the process of getting a new Homestead box up and running, installing Redis and installing the Echo Server. After some configuration changes he shows the installation of the Socket.io client and laravel-echo interface. Example code is included showing how to send the broadcast messages and to listen for broadcasted messages.

tagged: laravel tutorial socketio broadcast echoserver

Link: https://medium.com/@adnanxteam/how-to-use-laravel-with-socket-io-e7c7565cc19d

Community News:
ZendCon Keynotes Live Stream
Oct 23, 2012 @ 13:27:35

If you weren't able to make it to this year's ZendCon conference (happening right now in Santa Clara, CA) you can at least get a little taste of it though their live video stream of the keynotes.

There's five sessions they'll be sharing via the stream starting today and running through the 25th:

  • Opening Keynote - Andi Gutmans (Zend)
  • Open Source Cloud Technologies - Jimmy Guerrero (Red Hat, Inc.), Adrian Otto (Rackspace) and Peder Ulander (Citrix Systems)
  • The Media Industry and Moving to PHP - Raghu Bala (Source Interlink), Brent Pearson (UBM Technology)
  • PHP in the Cloud: Choice, Scale, Code, Simplify - Simone Brunozz (Amazon Web Services)
  • Zend Framework 2 - Practical Experience from the Trenches - Matthew Weier O`Phinney (Zend Technologies), Shawn Stratton (Discovery Communications, Inc.), Evan Coury (SouthwestMedical.com) and Mike Willbanks (CaringBridge)

The Opening Keynote starts at 8:30am PDT, so keep your eyes here for that broadcast.

tagged: zendcon12 live stream keynote broadcast conference

Link:


Trending Topics: