Learn Laravel Livewire 3 in 5 minutes

Поделиться
HTML-код
  • Опубликовано: 19 июл 2023
  • In this video, I'm teaching you how to use Livewire 3 in 5 minutes. Livewire is a Laravel package that makes creating reactive web applications easy.
    In this video, we're going to show you how to create a simple counter in Livewire 3. We'll walk you through the steps and explain the logic behind each step.
    Livewire 3 website :
    livewire.laravel.com/
    Boostrap Documentation:
    getbootstrap.com/docs/5.3/get...
    composer require livewire/livewire:^3.0@beta
    php artisan make:livewire Counter
    If you would like me to make more livewire videos, please let me know by liking the video and commenting what you like to learn next.
    What is livewire:
    Livewire is a full-stack framework for Laravel that makes building dynamic interfaces simple, without leaving the comfort of Laravel. (Taken from Livewire Documentation)

Комментарии • 22

  • @kareemlateefyomi8690
    @kareemlateefyomi8690 Год назад +5

    Great video, a crash course won't be bad where we can dive into more basic

    • @yelocode
      @yelocode  Год назад +2

      Thank you.
      I'm currently recording a series on livewire, will upload a long format crash course video in the next few days, hopefully.

  • @Odidi_Bee6ix
    @Odidi_Bee6ix 6 месяцев назад +2

    If I may ask are you working for laravel.
    Cause this is like the best laravel channel on RUclips . IMO🔥

    • @yelocode
      @yelocode  6 месяцев назад

      Thank you for the kind words. No, I don't work for the laravel team.

  • @upasnasingh05
    @upasnasingh05 3 месяца назад +1

    Basically livewire is replacing controllers right?? And i think livewire is much more compatible than rests ... Love your vids im learning live wire from your vids and its amazing 🎉

  • @mashingwachine824
    @mashingwachine824 Год назад +4

    First of all, amazing video bro! But I have a question, can you use laravel models inside the livewire component? Sorry I'm new to this.

    • @yelocode
      @yelocode  Год назад +2

      Thank you for watching.
      Yes, you can use models inside the components as well; almost anything you can do in controllers, you can do in livewire as well.
      I'm uploading a new video soon on building a search bar using Livewire, which will use models.

    • @mashingwachine824
      @mashingwachine824 Год назад +1

      @@yelocode thank you for responding and looking forward to that upcoming video!

    • @yelocode
      @yelocode  Год назад +2

      The search bar video is out : ruclips.net/video/vSOvVLSUN74/видео.html

  • @lordbluue3456
    @lordbluue3456 7 месяцев назад +1

    what is your extension for edit the icon in vscode?

    • @yelocode
      @yelocode  7 месяцев назад

      It's part of the theme I'm using, it's called monokai pro theme monokai.pro/vscode

  • @mahaalibrahim7934
    @mahaalibrahim7934 8 месяцев назад +1

    Good video

    • @yelocode
      @yelocode  8 месяцев назад

      Thanks for watching.

  • @hammodshamaseen
    @hammodshamaseen 11 месяцев назад +1

    Does it work on slow networks?

    • @yelocode
      @yelocode  11 месяцев назад +2

      Performance would be very similar to if you where to perform ajax requests in the background. However, you should only use livewire when you need interactive components that need data from the backend or perform a backend task. In other cases maybe can use alpine js for faster realtime performance

  • @a-ezzat5677
    @a-ezzat5677 Год назад +1

    thats so easy may you explain how to do it along with ui bootstrap and vite , because it is totally screwed up when we use vite

    • @yelocode
      @yelocode  Год назад

      If you are having any issues with vite, it's very likely not livewire related since views and blade files in livewire work exactly same as in laravel itself . I may make a video covering vite next week and provide an example with livewire too.

    • @a-ezzat5677
      @a-ezzat5677 Год назад +1

      @@yelocode may i know converting vite means get rid of using vite ? or we should use it because laravel is going to use it in future as i think, and please i would appreciate if you make a video how to use it along with bootstrap and vite not with tailwind
      , i also followed your instructions here but still wire:navigate not working and it is refreshing page , would you advice me, i noticed that localhost/livewire/livewire.js?id=578b80d0 not found with error code 404 altough i set my app_url in .env correctly matching exactly and it works after i have added this to web.php Livewire::setScriptRoute(function ($handle) {
      return Route::get('/blog/livewire/livewire.js', $handle);
      });, is there a way to fix it without adding those lines

    • @yelocode
      @yelocode  Год назад

      Laravel used to use webpack in older versions, but since v9 it's switched to vite, so from now on we have to use vite if you want to bundle your assets.
      For sure I will make a video covering Vite.
      On version 2 of livewire you could set an asset_url config to fix this but on livewire 3 the only solution is the one you have done yourself. However, this issue only applies if your application is in a subdirectory like in your situation.

    • @a-ezzat5677
      @a-ezzat5677 Год назад

      @codingflick may I know what do you mean in a subdirectory, If you mean htdocs and public folder I did move htaccess and index outside , another solution to use hosts file in Windows and apache host so I make a direct access to web app or site, so I can figure out from what you said that what I did to fix assets location is the only way or livewire3

    • @yelocode
      @yelocode  Год назад

      From your code it seems like you have your laravel app inside a /blog folder "/blog/livewire/livewire.js'" thats what I meant by sub directory.
      Yes if you want a php/laravel fix, your solution is the only way right now. But if you want to use host file or apache that one is also possible but depends on your webserver.