diff --git a/content/authors/DanSysAnalyst.md b/content/authors/DanSysAnalyst.md new file mode 100644 index 0000000..ca87686 --- /dev/null +++ b/content/authors/DanSysAnalyst.md @@ -0,0 +1,5 @@ +--- +username: DanSysAnalyst +name: 'Dan πŸ‡ΊπŸ‡¦' +avatar: 'https://pbs.twimg.com/profile_images/1378978815712628737/V2q0dtWi_normal.jpg' +--- diff --git a/content/authors/PovilasKorop.md b/content/authors/PovilasKorop.md new file mode 100644 index 0000000..b6ec7f3 --- /dev/null +++ b/content/authors/PovilasKorop.md @@ -0,0 +1,5 @@ +--- +username: PovilasKorop +name: 'Povilas Korop | Laravel Courses Creator & Youtuber' +avatar: 'https://pbs.twimg.com/profile_images/1576085948743524352/JQ-gfbyf_normal.jpg' +--- diff --git a/content/authors/enunomaduro.md b/content/authors/enunomaduro.md index c9fee18..9ff401a 100644 --- a/content/authors/enunomaduro.md +++ b/content/authors/enunomaduro.md @@ -1,5 +1,5 @@ --- username: enunomaduro -avatar: 'https://pbs.twimg.com/profile_images/1514432896102109185/LMj2oeW8_normal.jpg' -name: 'Nuno Maduro 🀌🏻' +avatar: 'https://pbs.twimg.com/profile_images/1573244584943042560/9Mq8p_QH_normal.jpg' +name: 'nuno maduro 🀌🏻' --- diff --git a/content/authors/freekmurze.md b/content/authors/freekmurze.md index 902ca77..b27f624 100644 --- a/content/authors/freekmurze.md +++ b/content/authors/freekmurze.md @@ -1,5 +1,5 @@ --- username: freekmurze -avatar: 'https://pbs.twimg.com/profile_images/1492514213381746692/DARB_SUs_normal.jpg' +avatar: 'https://pbs.twimg.com/profile_images/1578325143356678146/sf9MoAbW_normal.jpg' name: 'Freek Van der Herten πŸ”­' --- diff --git a/content/threads/weekly-thread-2022-35.md b/content/threads/weekly-thread-2022-35.md new file mode 100644 index 0000000..bac95b0 --- /dev/null +++ b/content/threads/weekly-thread-2022-35.md @@ -0,0 +1,13 @@ +--- +slug: weekly-thread-2022-35 +title: 'Weekly thread #35 of 2022' +tweet_id: '1596508349322866688' +author_username: archtechx +created_at: 2022-11-26T14:17:06+00:00 +links: { } +--- +πŸ”₯ We're back to posting our threads! + +In our news thread (will be posted shortly after this one), I'll share some updates about Tenancy v4 and our content schedule + +In the meantime: Best Laravel tips from the past few months πŸ‘‡ \ No newline at end of file diff --git a/content/tips/strmask-lets-you-mask-a-portion-of-a-string-with-a-character-eg.md b/content/tips/strmask-lets-you-mask-a-portion-of-a-string-with-a-character-eg.md new file mode 100644 index 0000000..5ca53be --- /dev/null +++ b/content/tips/strmask-lets-you-mask-a-portion-of-a-string-with-a-character-eg.md @@ -0,0 +1,11 @@ +--- +title: '`Str::mask()` lets you mask a portion of a string with a character (e.g. *)' +tweet_id: '1596508370952855553' +thread_slug: weekly-thread-2022-35 +author_username: PovilasKorop +images: + - 'https://pbs.twimg.com/media/FhCmZ9IX0AAiTED.jpg' +created_at: 2022-11-26T14:17:11+00:00 +slug: strmask-lets-you-mask-a-portion-of-a-string-with-a-character-eg +--- +Laravel tip. From Laravel 8.69, there's a "Str::mask()" method which masks a portion of the string with a repeated character like "*". diff --git a/content/tips/use-composer-outdated-direct-to-view-outdated-dependencies-of-your-app.md b/content/tips/use-composer-outdated-direct-to-view-outdated-dependencies-of-your-app.md new file mode 100644 index 0000000..d6626fc --- /dev/null +++ b/content/tips/use-composer-outdated-direct-to-view-outdated-dependencies-of-your-app.md @@ -0,0 +1,13 @@ +--- +title: 'Use `composer outdated --direct` to view outdated dependencies of your app' +tweet_id: '1596508368146817030' +thread_slug: weekly-thread-2022-35 +author_username: freekmurze +images: + - 'https://pbs.twimg.com/media/FfXlKEyWAAcxHaQ.jpg' +created_at: 2022-11-26T14:17:11+00:00 +slug: use-composer-outdated-direct-to-view-outdated-dependencies-of-your-app +--- +Using `composer outdated β€”direct` you can view any dependency of your app that has a major / minor / patch release available. + +Here’s the output for the Laravel app that powers https://freek.dev \ No newline at end of file diff --git a/content/tips/you-can-create-a-special-index-for-a-transformation-of-a-column.md b/content/tips/you-can-create-a-special-index-for-a-transformation-of-a-column.md new file mode 100644 index 0000000..4d90ccd --- /dev/null +++ b/content/tips/you-can-create-a-special-index-for-a-transformation-of-a-column.md @@ -0,0 +1,15 @@ +--- +title: 'You can create a special index for a transformation of a column' +tweet_id: '1596508360001482753' +thread_slug: weekly-thread-2022-35 +author_username: tobias_petry +images: + - 'https://pbs.twimg.com/media/FdvFZNTXwAAwzV6.jpg' +created_at: 2022-11-26T14:17:09+00:00 +slug: you-can-create-a-special-index-for-a-transformation-of-a-column +--- +⚑️ Database Tip + +Most developers are puzzled that indexes are not used for e.g. WHERE LOWER(email) = ?. But contrary to common belief, an index can be created for these cases! It's called a function-based index and is supported by MySQL and PostgreSQL. + +https://sqlfordevs.com/function-based-index \ No newline at end of file diff --git a/content/tips/you-can-echo-backed-enums-in-blade.md b/content/tips/you-can-echo-backed-enums-in-blade.md new file mode 100644 index 0000000..6b3142d --- /dev/null +++ b/content/tips/you-can-echo-backed-enums-in-blade.md @@ -0,0 +1,11 @@ +--- +title: 'You can echo backed enums in Blade' +tweet_id: '1596508357317185536' +thread_slug: weekly-thread-2022-35 +author_username: enunomaduro +images: + - 'https://pbs.twimg.com/media/FeQJefMXEAEnOON.jpg' +created_at: 2022-11-26T14:17:08+00:00 +slug: you-can-echo-backed-enums-in-blade +--- +Papercut: starting today's @laravelphp release, Blade can now infer values from PHP 8.1 backed enums. πŸ’…πŸ» \ No newline at end of file diff --git a/content/tips/you-can-run-your-tests-in-a-random-order.md b/content/tips/you-can-run-your-tests-in-a-random-order.md new file mode 100644 index 0000000..90ee9e5 --- /dev/null +++ b/content/tips/you-can-run-your-tests-in-a-random-order.md @@ -0,0 +1,15 @@ +--- +title: 'You can run your tests in a random order' +tweet_id: '1596508351872917504' +thread_slug: weekly-thread-2022-35 +author_username: DanSysAnalyst +images: + - 'https://pbs.twimg.com/media/FbeprM_XoAEDnVJ.jpg' +created_at: 2022-11-26T14:17:07+00:00 +slug: you-can-run-your-tests-in-a-random-order +--- +πŸ™‚πŸ™ƒπŸ™‚ Have you ever tried running your tests in random order? + +This can be helpful to detect interdependencies between tests. + +(works on @pestphp and PHPUnit) \ No newline at end of file diff --git a/content/tips/you-can-temporarily-disable-an-index-by-making-it-invisible.md b/content/tips/you-can-temporarily-disable-an-index-by-making-it-invisible.md new file mode 100644 index 0000000..bc7e975 --- /dev/null +++ b/content/tips/you-can-temporarily-disable-an-index-by-making-it-invisible.md @@ -0,0 +1,13 @@ +--- +title: 'You can temporarily disable an index by making it INVISIBLE' +tweet_id: '1596508362643865600' +thread_slug: weekly-thread-2022-35 +author_username: tobias_petry +images: + - 'https://pbs.twimg.com/media/Fcmcb3wWQAELfyk.jpg' +created_at: 2022-11-26T14:17:10+00:00 +slug: you-can-temporarily-disable-an-index-by-making-it-invisible +--- +⚑️ Database Tip + +Deleting an unused index is still a risky operation: If you are wrong (and it is still needed) the database will become slow. Before deleting it, you can make the index invisible first and make it visible again instantly if you still need it. \ No newline at end of file diff --git a/content/tips/you-can-use-a-partial-index-to-enforce-uniqueness-in-tables-that-can-have-soft-deleted-records.md b/content/tips/you-can-use-a-partial-index-to-enforce-uniqueness-in-tables-that-can-have-soft-deleted-records.md new file mode 100644 index 0000000..c1e4495 --- /dev/null +++ b/content/tips/you-can-use-a-partial-index-to-enforce-uniqueness-in-tables-that-can-have-soft-deleted-records.md @@ -0,0 +1,17 @@ +--- +title: 'You can use a partial index to enforce uniqueness in tables that can have soft-deleted records' +tweet_id: '1596508365370191873' +thread_slug: weekly-thread-2022-35 +author_username: tobias_petry +images: + - 'https://pbs.twimg.com/media/FhHXgF4XoAAHwU3.jpg' +created_at: 2022-11-26T14:17:10+00:00 +slug: you-can-use-a-partial-index-to-enforce-uniqueness-in-tables-that-can-have-soft-deleted-records +--- +⚑️ Database Tip + +Unique indexes can not be created in some cases because a value is duplicated by e.g. soft-deleted rows. + +But with partial indexes and creative tricks you can exclude some rows to create the uniqueness constraint on a selection of rows. + +https://sqlfordevs.com/unique-index-ignore-some-rows \ No newline at end of file diff --git a/content/tips/you-can-use-backticks-to-execute-a-shell-command-in-php.md b/content/tips/you-can-use-backticks-to-execute-a-shell-command-in-php.md new file mode 100644 index 0000000..d4624dc --- /dev/null +++ b/content/tips/you-can-use-backticks-to-execute-a-shell-command-in-php.md @@ -0,0 +1,15 @@ +--- +title: 'You can use backticks (``) to execute a shell command in PHP' +tweet_id: '1596508354536304640' +thread_slug: weekly-thread-2022-35 +author_username: freekmurze +images: + - 'https://pbs.twimg.com/media/FbbpXeyWIAAR40j.jpg' +created_at: 2022-11-26T14:17:08+00:00 +slug: you-can-use-backticks-to-execute-a-shell-command-in-php +--- +🐘 Can you believe I didn’t know that PHP has a backtick operator? + +Anything between `` will be executed like shell_exec and returned 🀯 + +Docs: https://www.php.net/manual/en/language.operators.execution.php \ No newline at end of file