mirror of
https://github.com/archtechx/laravel-tips.git
synced 2025-12-12 05:14:04 +00:00
parent
0e34bd3779
commit
f1e283e142
17 changed files with 160 additions and 3 deletions
5
content/authors/aschmelyun.md
Normal file
5
content/authors/aschmelyun.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
username: aschmelyun
|
||||||
|
name: 'Andrew Schmelyun'
|
||||||
|
avatar: 'https://pbs.twimg.com/profile_images/1079118209561841671/dI-xB5Az_normal.jpg'
|
||||||
|
---
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
username: bhaidar
|
username: bhaidar
|
||||||
name: 'Bilal Haidar'
|
name: 'Bilal Haidar . Laravel Enthusiast'
|
||||||
avatar: 'https://pbs.twimg.com/profile_images/1381347341400215552/LvVOFV9__normal.jpg'
|
avatar: 'https://pbs.twimg.com/profile_images/1381347341400215552/LvVOFV9__normal.jpg'
|
||||||
---
|
---
|
||||||
|
|
|
||||||
5
content/authors/fideloper.md
Normal file
5
content/authors/fideloper.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
username: fideloper
|
||||||
|
name: 'Chris Fidao'
|
||||||
|
avatar: 'https://pbs.twimg.com/profile_images/2256212126/fideloper_normal.jpg'
|
||||||
|
---
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
username: mattkingshott
|
username: mattkingshott
|
||||||
name: 'Matt Kingshott 🚀'
|
name: 'Matt Kingshott 🏝'
|
||||||
avatar: 'https://pbs.twimg.com/profile_images/1444979706571415564/toC9_E-T_normal.jpg'
|
avatar: 'https://pbs.twimg.com/profile_images/1444979706571415564/toC9_E-T_normal.jpg'
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
username: mmartin_joo
|
username: mmartin_joo
|
||||||
name: 'Martin Joo'
|
name: 'Martin Joo'
|
||||||
avatar: 'https://pbs.twimg.com/profile_images/1456657123639795724/5diaoilq_normal.jpg'
|
avatar: 'https://pbs.twimg.com/profile_images/1483820583703953408/xRSnZ96H_normal.jpg'
|
||||||
---
|
---
|
||||||
|
|
|
||||||
5
content/authors/mvpopuk.md
Normal file
5
content/authors/mvpopuk.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
username: mvpopuk
|
||||||
|
name: 'Marian Pop 🐘'
|
||||||
|
avatar: 'https://pbs.twimg.com/profile_images/1470871614594113537/C3AsiJLb_normal.jpg'
|
||||||
|
---
|
||||||
11
content/threads/weekly-thread-2022-03.md
Normal file
11
content/threads/weekly-thread-2022-03.md
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
---
|
||||||
|
slug: weekly-thread-2022-03
|
||||||
|
title: 'Weekly thread #03 of 2022'
|
||||||
|
tweet_id: '1484566695356211201'
|
||||||
|
author_username: archtechx
|
||||||
|
created_at: 2022-01-21T17:08:37+00:00
|
||||||
|
links: { }
|
||||||
|
---
|
||||||
|
🔥 This week's code tips for Laravel developers
|
||||||
|
|
||||||
|
A weekly thread 🧵
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
---
|
||||||
|
title: 'Array destructuring in PHP is very powerful, yet still underutilized'
|
||||||
|
tweet_id: '1484566707133825024'
|
||||||
|
thread_slug: weekly-thread-2022-03
|
||||||
|
author_username: aschmelyun
|
||||||
|
images:
|
||||||
|
- 'https://pbs.twimg.com/media/FJg9H52X0AYdyL3.jpg'
|
||||||
|
created_at: 2022-01-21T16:40:59+00:00
|
||||||
|
slug: array-destructuring-in-php-is-very-powerful-yet-still-underutilized
|
||||||
|
---
|
||||||
|
Array destructuring is probably one of my favorite things in modern PHP and I don't think I use it enough
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
---
|
||||||
|
title: 'Interesting technique: add getters to Form Requests'
|
||||||
|
tweet_id: '1484566716403183617'
|
||||||
|
thread_slug: weekly-thread-2022-03
|
||||||
|
author_username: mmartin_joo
|
||||||
|
images:
|
||||||
|
- 'https://pbs.twimg.com/media/FJYsa1fXMAQQlEr.jpg'
|
||||||
|
created_at: 2022-01-21T16:41:01+00:00
|
||||||
|
slug: interesting-technique-add-getters-to-form-requests
|
||||||
|
---
|
||||||
|
💪Power up your #Laravel requests
|
||||||
|
|
||||||
|
You can add very simple getters on the request, so:
|
||||||
|
✅You actually know what's on the request
|
||||||
|
✅You have types
|
||||||
|
✅You can do basic data transformation
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
---
|
||||||
|
title: 'Laravel''s Http client supports concurrent requests using the `pool` method'
|
||||||
|
tweet_id: '1484566722526924801'
|
||||||
|
thread_slug: weekly-thread-2022-03
|
||||||
|
author_username: mattkingshott
|
||||||
|
images:
|
||||||
|
- 'https://pbs.twimg.com/media/FJdr42eWQAcEVKh.jpg'
|
||||||
|
created_at: 2022-01-21T16:41:03+00:00
|
||||||
|
slug: laravels-http-client-supports-concurrent-requests-using-the-pool-method
|
||||||
|
---
|
||||||
|
🔥 #Laravel Tip: Need to make more than one HTTP request e.g. to one or more sites? You might think about running them concurrently to improve performance. The HTTP client's 'pool' method makes this a trivial exercise.
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
---
|
||||||
|
title: 'Laravel''s Slack logging channel is fully compatible with Discord'
|
||||||
|
tweet_id: '1484566698069876740'
|
||||||
|
thread_slug: weekly-thread-2022-03
|
||||||
|
author_username: LarsKlopstra
|
||||||
|
images:
|
||||||
|
- 'https://pbs.twimg.com/media/FJjSoysWUAI-HBq.jpg'
|
||||||
|
created_at: 2022-01-21T16:40:57+00:00
|
||||||
|
slug: laravels-slack-logging-channel-is-fully-compatible-with-discord
|
||||||
|
---
|
||||||
|
🤖🧠 Want to log errors or user activity to Discord? You can use the Slack driver to send Slack compatible webhooks to Discord!
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
---
|
||||||
|
title: 'Make Laravel send all emails to a specific email address using Mail::alwaysTo()'
|
||||||
|
tweet_id: '1484566719574130689'
|
||||||
|
thread_slug: weekly-thread-2022-03
|
||||||
|
author_username: fideloper
|
||||||
|
images:
|
||||||
|
- 'https://pbs.twimg.com/media/FJkqAzmXMAA5tlg.jpg'
|
||||||
|
created_at: 2022-01-21T16:41:02+00:00
|
||||||
|
slug: make-laravel-send-all-emails-to-a-specific-email-address-using-mailalwaysto
|
||||||
|
---
|
||||||
|
Just got schooled in a Laravel feature I was unaware of:
|
||||||
|
|
||||||
|
Tell Laravel to always send to a specific address!
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
---
|
||||||
|
title: 'Make models prunable to periodically delete them from the DB'
|
||||||
|
tweet_id: '1484566701089849344'
|
||||||
|
thread_slug: weekly-thread-2022-03
|
||||||
|
author_username: mmartin_joo
|
||||||
|
images:
|
||||||
|
- 'https://pbs.twimg.com/media/FJTZyx9XEAcctdk.jpg'
|
||||||
|
created_at: 2022-01-21T16:40:58+00:00
|
||||||
|
slug: make-models-prunable-to-periodically-delete-them-from-the-db
|
||||||
|
---
|
||||||
|
💡#Laravel Eloquent Tip
|
||||||
|
|
||||||
|
Laravel 8 introduced the Prunable trait. You can use it to delete old models on a scheduled basis.
|
||||||
|
|
||||||
|
You don't need to write custom commands anymore:
|
||||||
17
content/tips/mysql-has-a-blackhole-store-engine.md
Normal file
17
content/tips/mysql-has-a-blackhole-store-engine.md
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
---
|
||||||
|
title: 'MySQL has a blackhole store engine'
|
||||||
|
tweet_id: '1484566725597138944'
|
||||||
|
thread_slug: weekly-thread-2022-03
|
||||||
|
author_username: fideloper
|
||||||
|
images:
|
||||||
|
- 'https://pbs.twimg.com/media/FJklJacX0AIsUP1.jpg'
|
||||||
|
created_at: 2022-01-21T16:41:03+00:00
|
||||||
|
slug: mysql-has-a-blackhole-store-engine
|
||||||
|
---
|
||||||
|
👨🔬 Cool MySQL hack:
|
||||||
|
|
||||||
|
🧐 If your staging env has a table that ideally doesn't have data in it (esp production data)
|
||||||
|
|
||||||
|
🕳 You can make it a BLACKHOLE table
|
||||||
|
|
||||||
|
😅 I used this to make sure a table with a list of emails to send never contains any rows. Because, you know....
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
---
|
||||||
|
title: 'Specify the columns you want to select when fetching all() models'
|
||||||
|
tweet_id: '1484566713303584774'
|
||||||
|
thread_slug: weekly-thread-2022-03
|
||||||
|
author_username: bhaidar
|
||||||
|
images:
|
||||||
|
- 'https://pbs.twimg.com/media/FI-ea7zUcAIf9z3.jpg'
|
||||||
|
created_at: 2022-01-21T16:41:01+00:00
|
||||||
|
slug: specify-the-columns-you-want-to-select-when-fetching-all-models
|
||||||
|
---
|
||||||
|
🌶️ #Laravel tip: You can select the columns to run when using the Model::all() method. No need for an additional select() method.
|
||||||
|
|
||||||
|
A tiny tip to always keep in mind 💡
|
||||||
|
|
||||||
|
#PHP #Developers
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
---
|
||||||
|
title: 'Use Laravel''s task scheduler to run CLI commands — including shell scripts — at regular intervals'
|
||||||
|
tweet_id: '1484566710313054208'
|
||||||
|
thread_slug: weekly-thread-2022-03
|
||||||
|
author_username: mattkingshott
|
||||||
|
images:
|
||||||
|
- 'https://pbs.twimg.com/media/FJYySaNXIBA4lPW.jpg'
|
||||||
|
created_at: 2022-01-21T16:41:00+00:00
|
||||||
|
slug: use-laravels-task-scheduler-to-run-cli-commands-including-shell-scripts-at-regular-intervals
|
||||||
|
---
|
||||||
|
🔥 #Laravel Tip: The task scheduler is not limited to just commands. You can configure it to dispatch jobs and even execute shell scripts at regular intervals.
|
||||||
11
content/tips/you-can-name-migrations-like-this.md
Normal file
11
content/tips/you-can-name-migrations-like-this.md
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
---
|
||||||
|
title: 'You can name migrations "like this"'
|
||||||
|
tweet_id: '1484566704172634120'
|
||||||
|
thread_slug: weekly-thread-2022-03
|
||||||
|
author_username: mvpopuk
|
||||||
|
images:
|
||||||
|
- 'https://pbs.twimg.com/media/FJUAG2WXoAU2q_f.jpg'
|
||||||
|
created_at: 2022-01-21T16:40:58+00:00
|
||||||
|
slug: you-can-name-migrations-like-this
|
||||||
|
---
|
||||||
|
🔥 Epic Laravel Tip - Did you know that you don't necessarily have to use underscores for migrations names?
|
||||||
Loading…
Add table
Add a link
Reference in a new issue