1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-11 21:14:02 +00:00

Week 21/2022

This commit is contained in:
Samuel Štancl 2022-05-27 21:23:30 +02:00
parent 99fc7428d1
commit e42fd0da62
7 changed files with 75 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
username: JustinBTechGuy
name: 'Justin Byrne'
avatar: 'https://pbs.twimg.com/profile_images/992054782130032640/86q1ZDeK_normal.jpg'
---

View file

@ -0,0 +1,5 @@
---
username: morrislaptop
name: 'Craig Morris'
avatar: 'https://pbs.twimg.com/profile_images/1392560435942019072/24MDzj0X_normal.jpg'
---

View file

@ -0,0 +1,11 @@
---
slug: weekly-thread-2022-21
title: 'Weekly thread #21 of 2022'
tweet_id: '1530215255732649985'
author_username: archtechx
created_at: 2022-05-27T15:52:01+00:00
links: { }
---
🔥 This week's code tips for Laravel developers
A weekly thread 🧵

View file

@ -0,0 +1,15 @@
---
title: 'Laravel''s Http client lets you easily define retry attempts and a timeout'
tweet_id: '1530215263517298688'
thread_slug: weekly-thread-2022-21
author_username: freekmurze
images:
- 'https://pbs.twimg.com/media/FTosQF5WUAYV3PM.jpg'
created_at: 2022-05-27T15:52:03+00:00
slug: laravels-http-client-lets-you-easily-define-retry-attempts-and-a-timeout
---
😍 Laravels Http client is amazing. Using just a bit of code, you can specify a timeout, retry attempts, and immediately get the result as JSON.
Is there any other HTTP client written in #php that makes it this easy?
💪 Laravel

View file

@ -0,0 +1,12 @@
---
title: 'When creating jobs, only accept the needed data'
tweet_id: '1530215258135990272'
thread_slug: weekly-thread-2022-21
author_username: morrislaptop
images:
- 'https://pbs.twimg.com/media/FTihMVRXoAIt4AF.jpg'
- 'https://pbs.twimg.com/media/FTihNyPWIAAAsbE.jpg'
created_at: 2022-05-27T15:52:02+00:00
slug: when-creating-jobs-only-accept-the-needed-data
---
When creating Laravel Jobs, only accept the data you need to handle the job instead of large wrapper objects / models

View file

@ -0,0 +1,16 @@
---
title: 'You can avoid many n+1 issues by using lateral joins in MySQL'
tweet_id: '1530215268915417089'
thread_slug: weekly-thread-2022-21
author_username: tobias_petry
images:
- 'https://pbs.twimg.com/media/FTmHagcX0AEBn_k.jpg'
created_at: 2022-05-27T15:52:04+00:00
slug: you-can-avoid-many-n1-issues-by-using-lateral-joins-in-mysql
---
⚡️ Database Tip
Sometimes you want to get e.g. the last three orders for *every* customer. Normal joins can't do that. You have to execute n+1 queries in code, which is slow!
But with lateral joins, you can do one for-each loop join in SQL 🤯
https://sqlfordevs.io/for-each-loop-lateral-join

View file

@ -0,0 +1,11 @@
---
title: 'You can pass a custom view to the artisan down command'
tweet_id: '1530215260837142529'
thread_slug: weekly-thread-2022-21
author_username: JustinBTechGuy
images:
- 'https://pbs.twimg.com/media/FTROCoIWQAA54pF.jpg'
created_at: 2022-05-27T15:52:02+00:00
slug: you-can-pass-a-custom-view-to-the-artisan-down-command
---
TIL that you can use your own blade file for the maintenance mode screen in #Laravel by using the render option