Laravel Modal Using Alpine JS + Livewire 3

Поделиться
HTML-код
  • Опубликовано: 10 дек 2024

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

  • @mori181186
    @mori181186 Год назад +6

    Next Level!! Amazing Alpine and Livewire content :D

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

      Thanks Mori for the kind words. Glad the video was helpful.

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

    It's the perfect tutorial series for those who want to learn Livewire 3. This series is simple and straight-focused on the topic. not a single second is wasted here.
    Thank You @yelo Code
    #NOTES
    for those who are starting this now, you do not need to include Alpine CDN anymore It is included out of the box and you can create a livewire component for the modal instead of a regular blade component. the choice is yours.

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

    Awesome tutorial for live wire beginners. Developer from Theni,
    Tamilnadu, India

  • @mrcoder7438
    @mrcoder7438 Месяц назад +1

    really helped bro. finally got rid of bootstrap modal issue

  • @johnston777
    @johnston777 День назад

    Awesome tutorial! Thank you.

  • @GiorgiBekurashvili
    @GiorgiBekurashvili 9 месяцев назад +1

    One of the most useful tutorials at the time!!!

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

      Thanks for watching

  • @kouzokiodin3623
    @kouzokiodin3623 5 месяцев назад

    You are one of the best channels in dev thx bruh

  • @kreaweb-be
    @kreaweb-be Год назад +2

    Very well explaned and very practical.

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

    Great content and amazing video, thank you I am searching this type of video and got it ..

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

      Thanks for watching. glad to hear that.

  • @WallSpot
    @WallSpot 10 месяцев назад

    Thanks a lot...There was no tutorial on modal calling in latest version of laravel. Your videos helped me a lot.

  • @akashlmp
    @akashlmp Год назад +3

    Really awesome explanation ❤

  • @eduardodudu5695
    @eduardodudu5695 4 месяца назад

    Great i spent half day trying to make work some other packages and i did with this you are the man

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

    This was so helpful mate, thank so much for this video

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

      Glad it was helpful. Thanks for watching Helder.

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

    thankyou soo muchhh , this is really what I need , since using modal from flowbite that uses its own javascript removes initialization once it renders

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

    Amazing explanation, thank you!

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

      Thanks for watching.

  • @kadirertan8664
    @kadirertan8664 9 месяцев назад

    Great content as always.

  • @brandonjohn2434
    @brandonjohn2434 26 дней назад

    In AlpineJS, there is also an attribute called 'x-cloak' which basically hides the modal on page load. This way the 'display:none' styling is not needed.

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

    I think you are iranian, so: خیلی عشقی داداش.

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

      Yes bro, Thanks for watching.

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

    Nice tutorial, you should use the dialog element with the dialog api.
    This adds accessibility by forcing the modal to he in the very top layer of the dom handled by the browser and constraints the tab key to the modal, preventing scroll and adds an automatic backdrop that you can style with a pseudo class 😉

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

      Thank you for watching.
      Great point I don't think I have seen it used in Laravel Community before. Adding a dialog element would be very nice specially with the accessibility point you mentioned.
      Thank you for sharing bro will start using it myself.

    • @Sh1nitsu
      @Sh1nitsu 10 месяцев назад +1

      what is dialog element with dialog api?

    • @Stoney_Eagle
      @Stoney_Eagle 10 месяцев назад

      @@Sh1nitsu a quick mdn search will tell you everything you need to know😊

    • @mogr488
      @mogr488 3 месяца назад

      do you mean the HTMLDialogElement?

    • @Stoney_Eagle
      @Stoney_Eagle 2 месяца назад

      @@mogr488 yes it's documented under element dialog on mdn

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

    Thanks

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

      Thank you for watching

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

    helpful! Thank you

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

      Thanks for watching. Glad it was helpful!

  • @hshxy
    @hshxy 19 дней назад

    This is very interesting! Is there a way to have a code behind file for the modal, and handle the closing, opening from there?

  • @lexxkrt
    @lexxkrt 9 месяцев назад

    в случае передачи модели в коде html в функцию viewUser вы передаете json параметр, а не просто идентификатор (1,2,3...), т.е. лишние сведения в коде, что всегда приравнено к проблеме с безопасностью

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

    Like this video. Can you do a video about Select field with livewire. Async search that can search records from database. Not loading all data like 10 items per time. Select fields use in many places. ❤ Really appreciate

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

      Sure Thing, I have had multiple requests on this, I will try to make a video on it this week. Thanks for watching.

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

    I have been watching your livewire videos for a while now and learning a lot. Do you think I can build something like language reactor Chrome extension? Basically it adds subtitels and some interactivity to the video like adding vocab to study them later. Can this be achieved with livewire or will i need something like react or vue?

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

      Looking at the language reactor website and their extension, the video playback with live spoken word and translation highlighting, I don't think it's possible with livewire.
      You will have to write javascript to get that functionality. Maybe with livewire and some js you can get it done.
      But I personally would use Vue or React to build a website like they have. It will be easier to maintain in the long run.

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

      @@yelocode Thank you for your valuable input

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

      @@yelocode I like how easy it is to work with livewire, but I had this concern it might be messy to replicate this functionality with livewire. I am working on another project which I think livewire will be a perfect fit for. Thank you for your replay and keep up the good work :)

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

    @slot('body')
    @endslot
    That code above does not render the value passed to the blade component.
    The error undefined variable is returned. Even if you check if value is set, still it does not work.
    What is the problem, any idea?

  • @wlakovic
    @wlakovic 10 месяцев назад

    Thanks mate, amazing tutorial!
    I have a question, is it possible to render livewire component inside a modal? I was able to pass the selectedUser to it's mount method, and after I reached the render too, but after simply it doesn't render it into the modal.
    Edit: on second button click it loads the view properly, but I don't understand why does it work like that?
    Thanks in advance

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

    you are the best,

  • @BhavyaJain-t5d
    @BhavyaJain-t5d 5 месяцев назад

    i want to show this data in wire:model but i have to put the if condition to show the data in form when event is dispatched without if condittion geeting emptiy feed for name adress..

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

    Hi, thanks for the tutorial, I'm really thankfull, but I woulld like to make you a question, I've followed all the steps but I cannot make the buttom works right after I've search somethin' on the input, I mean it seems like the livewire stopped

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

    Thanks!!!!!!!!😁

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

    Can you make a modal who’s state is available in the url. Like ?modal=true&path=pathview

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

      You could add something like code below to your modal component so it can be toggled on and off using url hash. With URL params it's also possible just a bit more code.
      x-on:hashchange.window="show = (location.hash === '#'+name)"
      above code will show your modal if the url hash changes to the modal name. You can then use links to open and close the modal, also if the page reloaded, the modal will automatically open.
      I put the full version of a modal with url support here : gist.githubusercontent.com/MatinMN/06f3a488dc6619e3efb8db743cfc73c4/raw/d7c265999f0b56aea2b29a87254a88ad21cf173f/modal-with-urlhash-support.blade.php
      Hope it's helpful for your use case

  • @devilwarrior3108
    @devilwarrior3108 9 месяцев назад

    why doesn't bootstrap modal work?

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

    make TALL Stack course 🙏

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

      Will have more videos in the coming week. Thank you for the support.

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

    thankx, kindly make a modal using $dispatch only with livwire without alpine js , like a conditional rendering @if($isOpen) display the modal @endif

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

      Will create a livewire only modal video soon Mugerwa. Thank you for watching.

  • @Sh1nitsu
    @Sh1nitsu 10 месяцев назад

    I have a question. I clicked the create button inside a modal, then validation comes, then closed the modal. How to reset the validation so that after opening the modal it looks new again without the error message.

    • @mh5854
      @mh5854 9 месяцев назад

      Create a function and put $this->resetErrorBag(); in it inside the livewire component, use wire click to call the funcion on the close modal button

    • @mh5854
      @mh5854 9 месяцев назад

      Don't forget to use wire.ignore.self on the html tag where u have the modal id thst way the modal will not be closed on validation fails

  • @isaachatilima
    @isaachatilima 9 месяцев назад

    I need mentorship but your email address is not working 😞

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

    I'm having trouble with closing the modal, i'm using vite and livewirestyle

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

      I have the full code link in the description, maybe you can try compare and see if there are any differences. I don't think using vite would cause any issues. As long as you don't import alpine js multiple times

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

      @@yelocode when using tailwind cdn, modal is working. It has error regarding module.esm

  • @Naderabdou
    @Naderabdou 11 месяцев назад

    $this->dispatch('open-modal',name:'user-view-modal'); not working

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

      Have you created modal with name or not? If not than this will not work.

  • @Sh1nitsu
    @Sh1nitsu 10 месяцев назад

    Heloooo, Can you make a modal livewire with crud? Pleaseeeeeeeeeeeeeeee

  • @md.mominulhaque2157
    @md.mominulhaque2157 Год назад +1

    please create child modal

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

      Thanks for watching, I will put that in list of videos to make.

  • @onnewf9288
    @onnewf9288 9 месяцев назад

    thank you sir, this is very crystal clear tutorial 🙌
    i used to be confused by modal things, but after watching this tutorial i think i can understand the concept very well
    ruclips.net/user/sgaming/emoji/7ff574f2/emoji_u1f64c.png