Laravel 11 WebSocket

Sdílet
Vložit
  • čas přidán 25. 07. 2024
  • Source code: github.com/ERaufi
    For Push Notification : • Laravel Push Notificat...
    For Chat Application on Shared Hosting check out this Video: • Real-time Laravel Chat...
    For Real Time Notification on shared hosting check out this video: • Laravel SSE Real-Time ...
    Welcome to this comprehensive CZcams tutorial on Laravel WebSockets! If you're looking to enhance your Laravel applications with real-time communication capabilities, you've come to the right place. In this video, we'll take a deep dive into Laravel WebSockets, a powerful package that enables seamless and efficient real-time communication between the server and the client using WebSocket technology.
    Throughout this tutorial, we'll cover everything you need to know to get started with Laravel WebSockets. We'll begin by exploring the fundamentals, including the installation and configuration of the Laravel WebSockets package. We'll guide you through the process of setting up the WebSocket server, enabling you to establish bi-directional communication channels between the server and your application's clients.
    But that's not all! We'll also demonstrate how to leverage Laravel WebSockets to broadcast events and handle real-time data updates. Whether you're building chat applications, live notifications, collaborative features, or any other real-time functionality, Laravel WebSockets provides the necessary tools and infrastructure to make it happen.
    Join us on this exciting journey as we delve into the world of Laravel WebSockets and unlock the potential of real-time communication in your Laravel projects. Get ready to level up your Laravel development skills and take your applications to new heights!
    Chapters
    0:00 Introduction
    0:28 Installation
    2:16 Configurations
    3:00 Making an Event to Broadcast
    4:18 Setting the Blade file
    6:33 Running Reverb and Queue Servers
    8:58 Sending Data with the Event
    11:47 Creating Private Event and channel

Komentáře • 47

  • @jonathanjv1391
    @jonathanjv1391 Před 2 dny

    Thanks maaan, i can understand now how the broadcast works.

  • @balques425
    @balques425 Před 3 měsíci +2

    Nice video 😊

  • @NasirKhan-jy3gp
    @NasirKhan-jy3gp Před 3 měsíci

    ❤ nice and easy

    • @eraufi
      @eraufi  Před 3 měsíci

      Thank you! 😊

  • @m7mmadomar
    @m7mmadomar Před 2 měsíci

    Thank you for this wonderful explanation. I have a question: When working on two separate projects like Laravel and Angular, do I need to make such configurations and code for each to work?? Please, if you have enough time, create a video on this matter because I couldn't find any explanation on it.
    Also, what is the difference with the library laravel-websockets?

    • @eraufi
      @eraufi  Před 2 měsíci

      Yes, absolutely.
      laravel-websocket github repo has been archived. so we need to use laravel reverb to websockets. up to laravel 10 we used laravel-websockets

    • @m7mmadomar
      @m7mmadomar Před 2 měsíci

      @@eraufi Oh, I didn't notice that, I have used Laravel-websockets in my current project.
      Thank you for this.
      But I am facing difficulty with the library and how to host it on the server.

    • @eraufi
      @eraufi  Před 2 měsíci +1

      @@m7mmadomar you can read more about it in the official documentation
      laravel.com/docs/11.x/reverb

  • @MonirulIslam-sg7oh
    @MonirulIslam-sg7oh Před měsícem

    great and noce video

  • @JyothiPrakash-ql8np
    @JyothiPrakash-ql8np Před měsícem

    How do you start the server in video 7.10? You are returning to your browser and it is supposed to automatically work, but it is not working. the error for me: The site can't be reached

    • @eraufi
      @eraufi  Před měsícem

      i am using Laragon. so i don't have to run the application using PHP artisan serve. if you check the URL in the browser it end with .test

  • @abdulsamad-he8vr
    @abdulsamad-he8vr Před 20 dny +1

    How can i do this over Api.

    • @eraufi
      @eraufi  Před 20 dny

      for that you can view this video
      czcams.com/video/0BI_01zg8ng/video.html

  • @JonBrookes
    @JonBrookes Před 2 měsíci +1

    this is brailliant, thanks for posting. I was able to easily get all this working with Laravel 11 and reverb. I like your approach to using a mininum of code so it is straight forward to see what code is needed to be just enough to get things working. True MVP.
    in my experiments, my browser started playing up and I restarted it also, as well as chaning timeouts for the echo script. I also chose to use
    document.addEventListener("DOMContentLoaded", function () {
    console.log('starting public channel, ...');
    window.Echo.channel('testChannel')
    .listen('testingEvent', (e) => {
    console.log(e);
    });
    });
    as I found with my brosers sessions this, for now seemed to solve latency issues
    thanks again for this straigh forward, easy to follow walk through of Laravel 11, sockets and reverb

    • @eraufi
      @eraufi  Před 2 měsíci

      thanks a lot for your comment. such comments motivate us to continue.

  • @ShilpaPradeep-ss9hm
    @ShilpaPradeep-ss9hm Před 2 měsíci

    I have an issue of not receiving event in frontend. Do I need to do $this->broadcastVia('reverb') inside Event?

    • @eraufi
      @eraufi  Před 2 měsíci

      what are you using in frontend?

    • @ShilpaPradeep-ss9hm
      @ShilpaPradeep-ss9hm Před 2 měsíci

      @@eraufi I'm using vue

    • @eraufi
      @eraufi  Před 2 měsíci +1

      @@ShilpaPradeep-ss9hm in that case create a public channel first and test it. you can follow the steps in the video starting from 3:00 up to 9:00.
      if everything was working fine than create a private channel.

    • @ShilpaPradeep-ss9hm
      @ShilpaPradeep-ss9hm Před měsícem

      @@eraufi Thanks you for your reply. I have one more doubt, do we need to create reverb account like how we did in pusher?

    • @eraufi
      @eraufi  Před měsícem

      @@ShilpaPradeep-ss9hm no. no need for creating any account

  • @Daaboo
    @Daaboo Před 2 měsíci

    How to setup a private chat room with laravel api and vue frontend with Reverb?

    • @eraufi
      @eraufi  Před 2 měsíci

      you can create a private channel for that and give it a name then assign the users.

  • @reggienillas9617
    @reggienillas9617 Před 2 měsíci

    I am new to laravel and broadcasting, i followed your video and applied it in my single page application that i just created, however, I am getting broadcasting/auth 403 forbidden error, and also i checked the laravel.log, i have Array to string conversion error on my Event.php file, i hope you can help me with this

    • @eraufi
      @eraufi  Před 2 měsíci

      broadcasting/auth 403 forbidden. since you are making a SPA.I think you are using Vue or React and working with tokens. in that case, you are not sending the token. I found a StackOverflow question based on your question you can check that.
      stackoverflow.com/questions/41728930/laravel-broadcasting-auth-always-fails-with-403-error

    • @reggienillas9617
      @reggienillas9617 Před 2 měsíci

      @@eraufi yes i am using vue js3 laravel 11 reverb. Thank you

  • @diptobiswas6511
    @diptobiswas6511 Před 3 měsíci

    Uncaught TypeError: Cannot read properties of undefined (reading 'pirvate') . I changed milliseconds but it doesn't work for me 🤔

    • @eraufi
      @eraufi  Před 3 měsíci

      in that case check your resources/js/app.js.
      check if it's loaded correctly if the echo.js is there

    • @diptobiswas6511
      @diptobiswas6511 Před 2 měsíci +1

      @@eraufi Yeap it's working... thanks bro.

  • @josealejandrosanchez4180
    @josealejandrosanchez4180 Před 21 hodinou

    usas puser eso significa que es de pago ?

    • @eraufi
      @eraufi  Před 17 hodinami

      não, é totalmente gratuito

  • @quyle2185
    @quyle2185 Před 3 měsíci

    I have a issue with private event, it's not working!!

    • @eraufi
      @eraufi  Před 3 měsíci

      can you please be more specific about the problem you are facing

    • @quyle2185
      @quyle2185 Před 3 měsíci

      @@eraufi I forgot to add ShouldBroadcast in the event

    • @quyle2185
      @quyle2185 Před 3 měsíci

      @@eraufi Can I ask you something?

    • @quyle2185
      @quyle2185 Před 3 měsíci

      @@eraufi Can I connect flutter to it?

    • @eraufi
      @eraufi  Před 3 měsíci

      @@quyle2185 sorry i have not worked with Flutter. i don't know about it.
      but I think you can. the back end would be the same only you have to do the flutter logic

  • @PreciousOmegba
    @PreciousOmegba Před 3 měsíci

    Does this work for free without any subscription?

    • @eraufi
      @eraufi  Před 3 měsíci

      yes. It's completely free.

    • @eraufi
      @eraufi  Před 3 měsíci

      yes it's free. it's an open source package

  • @hennaraufi3368
    @hennaraufi3368 Před 3 měsíci

    😮😮😮😮

    • @eraufi
      @eraufi  Před 3 měsíci

      😮😮😮😮