You Don't Have to Delete Things Permanently

Поділитися
Вставка
  • Опубліковано 27 сер 2024
  • What would it look like if you wanted to build a "trash bin" for your application? That way your users don't permanently delete info every time they delete something.
    Laravel has something called Soft Deletes out of the box, so why don't we take a look.
    Links:
    Soft Delete documentation: laravel.com/do...
    Keep creating.
    ---
    📹 *Watch My VSCode Setup Video:* • My Minimal and Beautif...
    🎓 *Make VSCode Awesome - Caleb Porzio's Course (support me with this link):* gumroad.com/a/...

КОМЕНТАРІ • 21

  • @JonBrookes
    @JonBrookes Місяць тому

    amazing, yet another reason to use Laravel. I remember how arduous this was to do in apps without this built in. Thanks again Josh, another great vid. Another great feature

    • @joshcirre
      @joshcirre  Місяць тому

      Thanks Jon! I learned about Soft Deletes way too late, I did it all manually for an older application of mine, but no more! :)

  • @windows07
    @windows07 Місяць тому

    Great video as always, one of the first thing I learned was soft deletes

    • @joshcirre
      @joshcirre  Місяць тому

      So nifty! I haven't gotten to use them as much as I should!

  • @glennraya
    @glennraya Місяць тому +6

    You're wearing a hat again Josh, please be a normal Laravel dev. 🤣😝

    • @joshcirre
      @joshcirre  Місяць тому +4

      I don't know if I can ever be a normal Laravel dev. 🥲

    • @glennraya
      @glennraya Місяць тому +1

      @@joshcirre 😂😂😂

    • @andreyaires226
      @andreyaires226 Місяць тому +1

      Bro's too gangsta to be a normal dev.

  • @ajzack983
    @ajzack983 Місяць тому

    2:49 I think laravel magically knows the table's name when u follow the migration naming convention.
    So the --table wasn't necessary

    • @joshcirre
      @joshcirre  Місяць тому +1

      Thanks for the clarification! Good to know. :) I always forget when the naming takes over and when specifying names/tables/models etc. is helpful

  • @vasiovasio
    @vasiovasio 10 днів тому

    The autocomplete code in this video is INSANE!!!
    What is this? Plugin? AI?
    How can suggesting "Restore" and "Delete" links?!?

  • @michimarz
    @michimarz Місяць тому

    Can Laravel do event sourcing? Do you have a video on that or can recommend any?

    • @joshcirre
      @joshcirre  Місяць тому

      I’m trying out a Laravel Event sourcing package called “Verbs” right now. First foray into it all. I’ll have a video soon. 👀

  • @davidhida6821
    @davidhida6821 Місяць тому

    thanks josh for your work. I really love your videos. Can we softDelete a model wich is related to another one ?

    • @joshcirre
      @joshcirre  Місяць тому

      I believe so! I have not tested it but I don't see why not. Soft Deleting just is a way to easily set up the "deleted_at" column. Any cascading that you have set up to delete other models don't run until the instance is completely deleted.
      BUT there might be ways of automatically Soft Deleting related child records in another model if that's what you're looking for too. :)

    • @davidhida6821
      @davidhida6821 Місяць тому

      @@joshcirre thanks josh. I will test it. Hope to see a video about database constrains in laravel. Thanks for your work

  • @Netvirux
    @Netvirux Місяць тому

    Hi please I'm a PHP developer with experience in Laravel. I'm now exploring the possibility of integrating Laravel with React Native to build a website and a mobile application simultaneously. I'd love some guidance on how to get started with this project. Specifically, I'm unsure about how to create a mobile app using Laravel and React Native together.

    • @ifeanyinnaemego
      @ifeanyinnaemego Місяць тому

      Have tried it. You have to find a way to make your api URL secure. Ngrok can help you with that. I enjoyed that project

    • @zulfiqrysaadputra
      @zulfiqrysaadputra Місяць тому

      Use Laravel to build API and consume it inside your React Native apps.

    • @joshcirre
      @joshcirre  Місяць тому

      Using Laravel as a strict API is a good usecase for Laravel. There's even some Laracasts courses on how this would be accomplished, but I have it as a video idea here too. :)
      cir.re/suggest