Building a user following / unfollowing system with Laravel and InertiaJS

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 พ.ย. 2024

ความคิดเห็น • 18

  • @richard_keep
    @richard_keep 4 ปีที่แล้ว +1

    Great video. You can also style the FOLLOWING button in such a way that when you hover the mouse the text changes to UNFOLLOW with a red background.

    • @richard_keep
      @richard_keep 4 ปีที่แล้ว +1

      Please seed the DB with 500 followers and implement an infinite scroll that autoloads new data.

  • @alabaganne3772
    @alabaganne3772 3 ปีที่แล้ว +3

    can you upload source code to github please?

  • @dalivan5119
    @dalivan5119 3 ปีที่แล้ว +2

    Thanks! Go on with the works. Your tutorial are really good but how to check if user is already followed inside user profile page? I use $this->following()->where('follower_id', $user->id)->count(); inside model, doesn't work, please help.

    • @cdruc
      @cdruc  3 ปีที่แล้ว +1

      Hey!
      It's been a while since I recorded the video, but I guess you could do something like: $user->followers()->where('user_id', auth()->id())->exists() - and this will return a boolean saying if that particular user is followed by the authenticated user.

    • @dalivan5119
      @dalivan5119 3 ปีที่แล้ว +1

      @@cdruc The code its work, thanks! I appreciate your time.

  • @pradeepspace3
    @pradeepspace3 4 ปีที่แล้ว

    Great video Druc

  • @yasirarafat-dev
    @yasirarafat-dev 4 ปีที่แล้ว +1

    hello, can you make a detailed video on inertia
    progress indicators?

  • @mamadoery
    @mamadoery 3 ปีที่แล้ว

    What font do you have installed in VisualCode? Very nice!

  • @bentomlin
    @bentomlin 2 ปีที่แล้ว

    When unfollowing someone, it would be better if the person remained afterwards, but with a follow button, so that you can re-follow if you clicked the wrong one. In the example here they disappear because the whole list is re-rendered

  • @saktipujoedi8898
    @saktipujoedi8898 3 ปีที่แล้ว

    Great video

  • @mamadoery
    @mamadoery 3 ปีที่แล้ว

    How have you done the sidebar in tailwind, does it have the code somewhere or repository?

  • @suneeilthapa519
    @suneeilthapa519 3 ปีที่แล้ว

    Symfony\Component\Debug\Exception\FatalThrowableError : Call to a member funtion followings() on null [ laravel verion 5.6 ] Please help i got this error while php artisan migrate:fresh --seed

  • @samhk2222
    @samhk2222 3 ปีที่แล้ว

    Man, you're good

  • @creeddm
    @creeddm 4 ปีที่แล้ว

    Thanks for the video. I wonder if it is possible to recreate UI similar to Reddit with Inertia where you click on the post, it opens in the modal, page URL changes, but posts list stays in the background.

    • @creeddm
      @creeddm 4 ปีที่แล้ว

      I think twitter has the same behavior when you click on some image inside of a post.

    • @cdruc
      @cdruc  4 ปีที่แล้ว +1

      Inertia is not a silver bullet, and it's not particularly good with modals: github.com/inertiajs/inertia/issues/249 (although people are working hard on it).
      But yes, I think the scenario you described could be recreated with Inertia - at least the part with:
      "I'm on a list of posts, clicking on one will bring up a modal and will give me an url I can paste in another window and load the same post modal".
      But once you move to the "I also need to post comments from this modal" - then, you are better off by using a regular xhr.
      The idea is, inertia can help (a lot), but you still have to sprinkle some xhr from time to time :)

  • @mrluxury3480
    @mrluxury3480 3 ปีที่แล้ว

    can you share source code in github?