Make self-healing URLs with Laravel

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

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

  • @aarondfrancis
    @aarondfrancis  10 หลายเดือนก่อน +15

    Luke Downing turned this into a very good, very robust package! github.com/lukeraymonddowning/self-healing-urls

  • @ochronus
    @ochronus 10 หลายเดือนก่อน +69

    I wish I had content like yours 25 years ago when I was learning to code :)

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน +6

      That warms my heart. Thank you

  • @abdel17
    @abdel17 10 หลายเดือนก่อน +105

    Find someone who looks at you like Aaron looks at Laravel 🤣

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน +16

      difficulty level: impossible

    • @JagdeepSinghKalsi
      @JagdeepSinghKalsi 10 หลายเดือนก่อน +2

      Hold my beer....

    • @mbehboodian
      @mbehboodian 10 หลายเดือนก่อน

      Agreed

    • @pookiepats
      @pookiepats หลายเดือนก่อน

      😂😂😂😂 i like this guy but it’s not that good compared to the hype here, very python-y in its picky prickly version hell

  • @vasiovasio
    @vasiovasio 2 หลายเดือนก่อน

    Great implementation Aaron!
    This is actually Mandatory for every modern site - robust SEO, so don't worry about changes made in the title, Bookmarks always work even if some changes are made!
    For a unique guarantee for the public IDs, instead of another package, we can use just a simple MD5 hash over the primary ID + some secret key ( just a string to add entropy ) and get the last 8-10 characters.
    As I commented on the last video, simply look at how long the video is and how almost no time is required for something so fundamental that you can award your effort to every user and request in the future! :)

  • @andyhinkle
    @andyhinkle 10 หลายเดือนก่อน +11

    Wow -- This video left me in amazement, transitioning from moments of 'Huh... wow' to 'Whaaaat, I didn't know you could do that!' Incredible video Aaron! I didn't realize how much I needed it!

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน +2

      Thanks Andy! I appreciate that

  • @ossamasid3591
    @ossamasid3591 10 หลายเดือนก่อน +15

    Even if you know the solution from the beginning, watching Aaron explains it, is priceless!

  • @raphaeljaggerd3585
    @raphaeljaggerd3585 10 หลายเดือนก่อน +14

    I'm not a big PHP fan but Laravel just makes it worth it.

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน +5

      kind of agree haha

    • @pindab0ter
      @pindab0ter 10 หลายเดือนก่อน

      I’m the exact same.

  • @DioArsya
    @DioArsya 10 หลายเดือนก่อน +1

    I found your videos mostly from Planetscale yt channel, the explanations are just *🤯💥”. Thank you & subscribed! haha

  • @KieranHolroyd
    @KieranHolroyd 10 หลายเดือนก่อน +28

    hash ID's aren't usually for security, it's use is primarily when you want an "unlisted" option, it also has good uses if you're using some kind of sharding, as it (some implementations) can use machine-specific information in the hash, it's not all random.

  • @pythonantole9892
    @pythonantole9892 10 หลายเดือนก่อน

    Oh my, there's so much to learn. I didn't even know self-healing urls were a thing.

  • @MattMcT
    @MattMcT 8 หลายเดือนก่อน

    Your content is freaking fantastic! Thank you so much for your energy and knowledge! ❤🎉😊

  • @ahmad-murery
    @ahmad-murery 10 หลายเดือนก่อน +13

    You're skill at explaining things is beyond what I've dealt with so far
    One more time, please make a Laravel course.
    Thanks Aaron!

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน +12

      🥹 I'm thinking about it tbh

    • @ahmad-murery
      @ahmad-murery 10 หลายเดือนก่อน

      @@aarondfrancis You're the one 👍🚀

    • @edwinshadian2852
      @edwinshadian2852 10 หลายเดือนก่อน +1

      @@aarondfrancis it will be really nice and not only for beginners. You have rare talent in explaining complicated things simply. And I see that you're really like it. A lot of new PHP developers will be grateful if you will make a Laravel course

  • @VadimBesedin
    @VadimBesedin 10 หลายเดือนก่อน

    What a nice and elegant solution. Thank you. And explanation style is great as well.

  • @dominuskelvin
    @dominuskelvin 10 หลายเดือนก่อน

    Wow. First off you are a great teacher Aaron. Second, Laravel make this too easy.

  • @gregjfarias
    @gregjfarias 10 หลายเดือนก่อน

    I've been working with Laravel for like 3 years, watching your material is like getting a fat-fast dose of knowledge. Amazing

  • @DPSGulag
    @DPSGulag 8 หลายเดือนก่อน

    Great video!
    The concept struck me in awe so much I ended up playing with it first, then implementing it for my website.
    Had to take a completely different approach (using Request $request) due to how our codebase is now, but with the same principles and it worked magic.
    Found you out recently and I'm very pleased with the content so far!

  • @mityukov
    @mityukov 10 หลายเดือนก่อน

    Nice dive into Laravel model binding

  • @rsfllw
    @rsfllw 10 หลายเดือนก่อน

    this is the first of your videos which I've seen, and I'm primarily back end, but by company are just spinning up a 'look at me' product team I'm definintely going to send them this vid!
    +subbed

  • @pindab0ter
    @pindab0ter 10 หลายเดือนก่อน +1

    Very, very cool video! Even though I might not use this specific example, the general approach of using the more advanced tools Laravel makes available is very inspiring!

  • @MMDM95
    @MMDM95 10 หลายเดือนก่อน

    Awesome, I always get happy when you post a video. Thanks a lot🤩. Please post more often

  • @adampatterson
    @adampatterson 9 หลายเดือนก่อน

    Nice, I did this years ago on a big 20,000 unit automotive site /year-make-model-trim-city/stock-number and totally forgot about the URL structure until now.
    I create a service that would generate the SEO slug and then ran a schedule task that cached the sitemaps and product feeds.
    Another tip SEP wise is to setup a canonical structure if you might have a lot of url variations, obviously a blog is different.

  • @xinotsultan3867
    @xinotsultan3867 5 หลายเดือนก่อน

    Its new knowladge, and actually very usable

  • @julienSibille
    @julienSibille 10 หลายเดือนก่อน +1

    Please do stuff, you do it so well !
    Thank you for sharing knowledge !

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน +1

      what a nice thing to say 🥹 thank you

  • @violin245
    @violin245 10 หลายเดือนก่อน

    Absolutely incredible videos from you this year! Thanks!

  • @Exilum
    @Exilum 10 หลายเดือนก่อน +2

    I don't use Laravel, but this was a cool idea I might use in the future. I hadn't really thought about it as something I'd want, until I thought about people who favorite a page that could change names.

  • @estelsmith7175
    @estelsmith7175 10 หลายเดือนก่อน +4

    You're really good at explaining things. Your style is easy to follow along with, I wish I had some videos like this when I was starting out.
    Do you ever plan to do videos with Symfony, too?

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน +1

      Thank you so much! Probably not at this point, I'm mostly a Laravel user so I don't know much about Symfony

  • @tannercampbell
    @tannercampbell 10 หลายเดือนก่อน

    what a fun and useful idea! great job 👏

  • @I_Lemaire
    @I_Lemaire 10 หลายเดือนก่อน

    Thank you for this video.

  • @geHuC
    @geHuC 10 หลายเดือนก่อน +2

    For those still living the apache life, you can always have a .htaccess rule with some regex that would behave the same way as amazons.

  • @sheldon98c
    @sheldon98c 10 หลายเดือนก่อน

    I have implemented a feature similar to this in my app manually.
    I was not aware of those inbuilt functions.
    I need to read docs 🚀

  • @RealDyllon
    @RealDyllon 10 หลายเดือนก่อน +1

    Great video on laravel! You should try making videos about databases too!

  • @BlueeyesChineseguy
    @BlueeyesChineseguy 10 หลายเดือนก่อน +2

    I dont know a thing about php or laravel but the concept is interesting!

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน

      mission accomplished then! 🫡

  • @kachelle
    @kachelle 10 หลายเดือนก่อน

    Great video! Immediately used it!

  • @winchester2581
    @winchester2581 10 หลายเดือนก่อน

    Wow! The idea is pretty amazing! The video made me think about .Net and how to implement it correctly (as I'm .Net dev). Laravel looks pretty cool tho

  • @EinLinuus
    @EinLinuus 10 หลายเดือนก่อน

    This is awesome! Please make a Laravel course, that would be so cool 😄

  • @SeyedMansour27
    @SeyedMansour27 10 หลายเดือนก่อน

    More Laravel Please! i would love to see efficiency and production advise!

  • @MrNichuya
    @MrNichuya 10 หลายเดือนก่อน +1

    Big brain Aaron 👍

  • @starcity254
    @starcity254 10 หลายเดือนก่อน

    veery awesome. loved it.

  • @danfg7215
    @danfg7215 10 หลายเดือนก่อน +1

    I gotta be honest, this is pretty cool. I would've done it a lot uglier if I had to figure it out myself.

  • @massadda5449
    @massadda5449 10 หลายเดือนก่อน

    You really good explaining

  • @rezanbs
    @rezanbs 5 หลายเดือนก่อน

    wow it was awesome

  • @veds-art-world
    @veds-art-world 10 หลายเดือนก่อน

    You can create public_id as ulid(provided by laravel) instead of string to generate unique string without any complications.

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน

      ULIDs are really really long, and ugly though!

  • @soniablanche5672
    @soniablanche5672 10 หลายเดือนก่อน

    if you want to use javascript style method on strings, you can use the laravel Str class helper
    use Illuminate\Support\Str;
    Str::of("some/string/I/want/to/split")->split("/\//")->last();

    • @azzazkhansiddiqui
      @azzazkhansiddiqui 10 หลายเดือนก่อน

      Doing last(explode("/", "some/string/I/want/to/split")) feels a bit easier than chaining three methods.

  • @mohit84604
    @mohit84604 10 หลายเดือนก่อน

    Thank you sir!. Can you teach us other more advance stuff of backend plz.

  • @borisjoffe
    @borisjoffe 6 หลายเดือนก่อน +1

    That's pretty cool, but why not put the slug at the front? That way someone copying a URL and missing the last letter or so would still get to the right page.

  • @LinacchiUwU
    @LinacchiUwU 10 หลายเดือนก่อน

    We use a old 1.12 version of Zend Framework at work which kinda made me hate php, but this does look pretty nice! Maybe I should give it a try someday

  • @yunier91
    @yunier91 10 หลายเดือนก่อน

    Is SEO the only reason to use self-healings URLs? I'm trying to understand when and why I would use self-healing URLs, thank you.

  • @Torbikini
    @Torbikini 10 หลายเดือนก่อน

    I might have to give Laravel a try now 👀
    I am looking to make a new Vue project, so I’ll have to see how that would work with Laravel exactly, but this seems like a good backend choice.

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน +1

      Totally! Laravel has a starter kit that's Laravel + Vue: laravel.com/docs/10.x/starter-kits#breeze-and-inertia

    • @Torbikini
      @Torbikini 10 หลายเดือนก่อน

      Thank you for sharing that! I’ll give it a look 👀

  • @francismori7
    @francismori7 10 หลายเดือนก่อน +2

    Only thing I would change here Aaron is that you are hardcoding the route name in your redirect, so you will not be able to use your model binding on a different route

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน +1

      Hmm that's a good point! I guess I should've inferred that from the current route

    • @francismori7
      @francismori7 10 หลายเดือนก่อน

      ​@@aarondfrancisyeah, but then, you may have issues with child routes... /posts/{post}/comments/{comment}. You will have to provide all attributes to properly generate the route. It's not as simple as I initially thought 🤔

    • @azzazkhansiddiqui
      @azzazkhansiddiqui 10 หลายเดือนก่อน

      @@francismori7 I guess we can replace the provided slug with our generated one in the request and redirect to replaced one though if you find a better solution please do share it.

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน

      @francismori7 @azzazkhansiddiqui here's a solution! github.com/lukeraymonddowning/self-healing-urls

  • @MiklosGalicz
    @MiklosGalicz 10 หลายเดือนก่อน

    Well, the security reason behind the hiding the incremental id is mostly because of the backend app devs not checking authorizations properly or your basic CRUD app doesn't offer the necessary access control features...

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน

      Right, which is why I'm unmoved by that argument

    • @MiklosGalicz
      @MiklosGalicz 10 หลายเดือนก่อน

      @@aarondfrancis tbh, I like my uuids 😅

  • @willi1978
    @willi1978 10 หลายเดือนก่อน

    interesting concept. i use neither laravel nor php but it can be implemented in other languages too

  • @abdallakaram5376
    @abdallakaram5376 10 หลายเดือนก่อน

    Amazing

  • @pierredonias8940
    @pierredonias8940 10 หลายเดือนก่อน +1

    Very nice! It's just a shame that it's based on an ID. Reading the title, I was expecting some kind of error correction if there's a typo in the URL by comparing it to valid URLs, calculating distances, etc.

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน

      You could do that if you wanted using the same methods

  • @Pang-nn4eq
    @Pang-nn4eq 10 หลายเดือนก่อน

    hashed ids are nice because u can authenticate them and give access to resources based on URI as a "password"

  • @dhananjay7513
    @dhananjay7513 10 หลายเดือนก่อน

    This is cool exploration but I couldn't find a way how can this be beneficial luke having an expressive url is SEO friendly but how does self healing makes any difference in how someone search product, The only point I can think of is that they just have to type correct hash and they will be redirected to correct seo friendly domain but is this it?

  • @vinayakdevc6
    @vinayakdevc6 10 หลายเดือนก่อน

    this guy is awesome

  • @peanut3645
    @peanut3645 10 หลายเดือนก่อน

    Отличное видео, очень нравится как ты говоришь. Возможно для презентации подошла бы светлая тема редактора, чтобы не мигало на видео. Не повлияет ли на CEO если Id будет в начале?

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน +1

      Good idea! I'll look into that. I the putting the ID at the end is more of an aesthetic thing, I'm not sure it would matter too much.

  • @SeyedMansour27
    @SeyedMansour27 10 หลายเดือนก่อน

    I have 2 questions:
    1. whats the point of having this urls? the only thing i can think of is SEO because you can have several different urls with different names point to a single one each containing different tags? (is that even good?:)
    2. if the url needs to heal you pass the model to the route 8:30 but you get it from db again? (line 22 happens again based of your explanations) can't we somehow skip this second db call?

  • @francescoleto2823
    @francescoleto2823 10 หลายเดือนก่อน

    Cooool

  • @amiralam1786
    @amiralam1786 10 หลายเดือนก่อน

    your videos are AMAZING! but most of them are for laravel/php devs, can you also cover topics which could help node js backend devs too?

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน +2

      I cannot, because I'm not a node expert

  • @enzofalone
    @enzofalone 10 หลายเดือนก่อน +1

    What text editor are you using?

  • @DaviMartins99
    @DaviMartins99 10 หลายเดือนก่อน

    When are we getting Holly videos?!
    Just kidding ofc, awesome content, Aaron!

  • @filipkalny6594
    @filipkalny6594 10 หลายเดือนก่อน

    So the part of the url that's self-healing is the part that's actually entirely redundant? I was expecting some actual error-correction.

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน

      Sorry to disappoint! Hopefully you'll enjoy my next videos more

  • @DownloadableFox
    @DownloadableFox 10 หลายเดือนก่อน

    What's the point of having the post title as a path in the url? Wouldn't it be simpler just to use the ID of the post? /gen

    • @DownloadableFox
      @DownloadableFox 10 หลายเดือนก่อน

      Like instead of:
      .../posts/this-is-a-post-abc123
      Just use
      .../posts/abc123

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน

      Generally a descriptive url is a good seo signal!

  • @feldinho
    @feldinho 10 หลายเดือนก่อน

    As someone outside Laravel it's so weird having the model parsing route parameters by itself. I feel kinda dirty now.

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน

      kinda dirty, but also... kinda awesome huh

    • @feldinho
      @feldinho 10 หลายเดือนก่อน

      @@aarondfrancis I could get used to that :)

  • @guillermocava3568
    @guillermocava3568 10 หลายเดือนก่อน +3

    server rendered sites 1 - static stites 0

  • @gagemonster555
    @gagemonster555 10 หลายเดือนก่อน

    How does this handle html anchors/#?

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน

      hmmm I don't know, but probably not very well tbh!

  • @mikeeomega
    @mikeeomega 10 หลายเดือนก่อน

    Be nice with Medium, there are many Laravel devs sharing posts there

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน

      haha, sorry 🤐

  • @1stKillZone
    @1stKillZone 10 หลายเดือนก่อน

    "Medium who even goes there anymore" quoted by a PHP developer in 2023

  • @vikingthedude
    @vikingthedude 10 หลายเดือนก่อน

    Are you the same guy who makes videos at planetscale?

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน +1

      It is me 🫡

  • @jvnko
    @jvnko 10 หลายเดือนก่อน

    Ayo, what theme do you have in your ide?

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน

      It's a super old one called Heroku, by Dayle Rees

  • @GuRuGeorge03
    @GuRuGeorge03 10 หลายเดือนก่อน

    Lol to even come up with this idea. I wonder if it was a customer who requested it or if a developer was just bored or somehow needed it

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน +1

      Haha who knows. Amazon is kinda famous for having URLs that are really reslient, even decades later

  • @kyleridolfo
    @kyleridolfo 10 หลายเดือนก่อน

    Aaron we need you to reveal your biggest secret... how do we get our eyeglasses to not reflect light at the camera? 👓

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน +1

      🤐🤐🤐
      (My recording glasses have no lenses)

    • @kyleridolfo
      @kyleridolfo 10 หลายเดือนก่อน

      ​@@aarondfrancis Incredible! The master.

    •  10 หลายเดือนก่อน

      Polarizing filter, my friend.

  • @MichaelLazarski
    @MichaelLazarski 10 หลายเดือนก่อน

    Whats that browser?

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน +1

      Chrome!

    • @MichaelLazarski
      @MichaelLazarski 10 หลายเดือนก่อน

      @@aarondfrancis do I miss some update ? haha mine does not look like that

  • @bbbbburton
    @bbbbburton 10 หลายเดือนก่อน

    Redirect should contain status code 301

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน

      eh I'm not so sure! 301s can be super permanent, and if the user changes their mind and updates the post title back to what it was originally, you might be hosed.

    • @bbbbburton
      @bbbbburton 10 หลายเดือนก่อน +1

      @@aarondfrancis Then I'd suggest a canonical tag be present on the page, with a version of the URL not containing the slug.
      If SEO is important, I'm trying to ensure search engines index a single version of the page.
      I'm also not sure about the 301. What does happen when a user changes a new title back to the original? I think the browser and search engines will resolve it okay. But I haven't done this stuff in years so please correct me if I'm wrong!

  • @Bartek2OO219
    @Bartek2OO219 10 หลายเดือนก่อน

    why you don't just use id?

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน

      For reasons explained in the video!

  • @HSBTechYT
    @HSBTechYT 10 หลายเดือนก่อน

    Why is this needed 🤔

  • @ambuj.k
    @ambuj.k 10 หลายเดือนก่อน

    As a Typescript developer, Laravel always seems like black magic to me.

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน +1

      In a good way right?

    • @ambuj.k
      @ambuj.k 10 หลายเดือนก่อน

      @@aarondfrancis Exactly!

  • @LOO_KING97
    @LOO_KING97 10 หลายเดือนก่อน

    Hey

  • @herosova
    @herosova 10 หลายเดือนก่อน

    I use codeignitor 4 will society accept me?

    • @alexmaven
      @alexmaven 10 หลายเดือนก่อน

      Society won’t but Aaron will…. If you learn Laravel. 😂

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน

      😂

  • @instagramaccount6748
    @instagramaccount6748 10 หลายเดือนก่อน

    How do with nextjs

    • @aarondfrancis
      @aarondfrancis  10 หลายเดือนก่อน

      I've never used it