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/...
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
Thanks Jon! I learned about Soft Deletes way too late, I did it all manually for an older application of mine, but no more! :)
Great video as always, one of the first thing I learned was soft deletes
So nifty! I haven't gotten to use them as much as I should!
The autocomplete code in this video is INSANE!!!
What is this? Plugin? AI?
How can suggesting "Restore" and "Delete" links?!?
You're wearing a hat again Josh, please be a normal Laravel dev. 🤣😝
I don't know if I can ever be a normal Laravel dev. 🥲
@@joshcirre 😂😂😂
Bro's too gangsta to be a normal dev.
2:49 I think laravel magically knows the table's name when u follow the migration naming convention.
So the --table wasn't necessary
Thanks for the clarification! Good to know. :) I always forget when the naming takes over and when specifying names/tables/models etc. is helpful
thanks josh for your work. I really love your videos. Can we softDelete a model wich is related to another one ?
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. :)
@@joshcirre thanks josh. I will test it. Hope to see a video about database constrains in laravel. Thanks for your work
Can Laravel do event sourcing? Do you have a video on that or can recommend any?
I’m trying out a Laravel Event sourcing package called “Verbs” right now. First foray into it all. I’ll have a video soon. 👀
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.
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
Use Laravel to build API and consume it inside your React Native apps.
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