🔥 Most applications need to export and import large amounts of data.
It is very easy to:
- Waste lots of memory
- Perform hundreds or thousands of unnecessary DB queries
You can avoid them by learning some pretty simple techniques.
🧵 Keep Reading
#Laravel and #PHP devs: after working with enum classes for a while I noticed that for every class I wanted to implement a method to check on the specific case so decided to go with a meta-programming way to give me this method for free
⚡️ Database Tip
When doing statistical aggregations by time, you may have e.g. days without data leading to strange results when charting the results. But you don't have to fill these gaps manually with code, the database can do that for you.
https://t.co/4QGB7HZBxA
#laravel tip 🔥: i want represent a way how to use sub query to select a column for a specific requirement i think this way is good for this use case when u want to check if this thing is favourite or not in pivot table here's an example how to do this .
مبارك كان مخلف اتنين وسوزان كانت ليدي وجسمها متناسق مع سنها ولبسها كان لايق عليها وماكنوش بيطلعوا يعايرونا بالتخن والرفع والخلفة الكتير زي واحد صاحبنا فيه كل العبر هو واسرته وبيطلع يبكت فينا ولا اللي بناكل من طبقه
If you're calling a rate limited API that supports multiple regions, you can implement a simple round robin approach to calling the API, allowing you to multiply the allowed rate limits by the number of supported regions. Pair this with Laravel's maxExceptions in a job, and you have auto-retrying to different regions if an exception (like a rate limit) occurs 💅
⚡️#Laravel devs, sunday tip here for you.
Did you know you can add more observable events to #eloquent? To better represent your business model.
You can then listen for and fire these events.
- Create trait, add your custom events, and use the trait in your model.
[1/2]