You Don't Have to Delete Things Permanently

Поделиться
HTML-код
  • Опубликовано: 25 авг 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!

  • @vasiovasio
    @vasiovasio 8 дней назад

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

  • @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

  • @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

  • @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. 👀

  • @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