mirror of
https://github.com/archtechx/laravel-tips.git
synced 2025-12-11 21:14:02 +00:00
Week 25/2022
This commit is contained in:
parent
a955c3968b
commit
c8f91bbe4b
6 changed files with 66 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
username: timacdonald87
|
||||
avatar: 'https://pbs.twimg.com/profile_images/1495883253445959681/xLo3tosq_normal.jpg'
|
||||
name: 'Tim MacDonald'
|
||||
avatar: 'https://pbs.twimg.com/profile_images/1249274319059841024/-8bpTPMC_normal.jpg'
|
||||
---
|
||||
|
|
|
|||
11
content/threads/weekly-thread-2022-25.md
Normal file
11
content/threads/weekly-thread-2022-25.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
slug: weekly-thread-2022-25
|
||||
title: 'Weekly thread #25 of 2022'
|
||||
tweet_id: '1540401124192112640'
|
||||
author_username: archtechx
|
||||
created_at: 2022-06-24T18:27:01+00:00
|
||||
links: { }
|
||||
---
|
||||
🔥 This week's code tips for Laravel developers
|
||||
|
||||
A weekly thread 🧵
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
title: 'Rows can be stored in an already sorted way, instead of the default insertion order'
|
||||
tweet_id: '1540401132014411776'
|
||||
thread_slug: weekly-thread-2022-25
|
||||
author_username: tobias_petry
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/FV2QgKRXwAIxTR_.jpg'
|
||||
created_at: 2022-06-24T18:27:03+00:00
|
||||
slug: rows-can-be-stored-in-an-already-sorted-way-instead-of-the-default-insertion-order
|
||||
---
|
||||
⚡️ Database Tip
|
||||
|
||||
In most applications, all rows are physically sorted in the database file by their insertion order. By sorting them instead optimally for your application a huge databases will still be amazingly fast.
|
||||
|
||||
https://sqlfordevs.io/sorted-table-faster-range-scan
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
title: 'str()->plural() lets you convert words to their right form based on a provided amount'
|
||||
tweet_id: '1540401129363623936'
|
||||
thread_slug: weekly-thread-2022-25
|
||||
author_username: ecrmnn
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/FV3zlAPVEAAWxIr.jpg'
|
||||
created_at: 2022-06-24T18:27:03+00:00
|
||||
slug: str-gtplural-lets-you-convert-words-to-their-right-form-based-on-a-provided-amount
|
||||
---
|
||||
Printing a word in singular or plural form depending on the number of items is usually a pain.
|
||||
|
||||
With Laravel Str / Stringable however, it's a breeze 🍃 😍
|
||||
11
content/tips/string-ids-can-be-case-sensitive.md
Normal file
11
content/tips/string-ids-can-be-case-sensitive.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
title: 'String IDs can be case sensitive'
|
||||
tweet_id: '1540401134761701376'
|
||||
thread_slug: weekly-thread-2022-25
|
||||
author_username: ecrmnn
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/FVtZhvQUUAYjTE_.jpg'
|
||||
created_at: 2022-06-24T18:27:04+00:00
|
||||
slug: string-ids-can-be-case-sensitive
|
||||
---
|
||||
You can make your IDs case sensitive when using strings as primary keys in Laravel ✨
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
title: 'You can generate fake values anywhere in your app using the new `fake()` helper'
|
||||
tweet_id: '1540401126696030208'
|
||||
thread_slug: weekly-thread-2022-25
|
||||
author_username: timacdonald87
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/FV5jtc0aAAATJNK.jpg'
|
||||
created_at: 2022-06-24T18:27:02+00:00
|
||||
slug: you-can-generate-fake-values-anywhere-in-your-app-using-the-new-fake-helper
|
||||
---
|
||||
Enjoying the little things: the new `fake()` helper we introduced to Laravel.
|
||||
|
||||
Because it is a singleton, you can get unique values across multiple calls / boundaries.
|
||||
|
||||
Super useful for tests, factories, seeders, and for quickly prototyping a design with fake data ✌️
|
||||
Loading…
Add table
Add a link
Reference in a new issue