From f1e283e142f46aeb7fde2ae8bddbfd430796f447 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Fri, 21 Jan 2022 18:22:44 +0100 Subject: [PATCH] Add weekly thread #3 (#25) --- content/authors/aschmelyun.md | 5 +++++ content/authors/bhaidar.md | 2 +- content/authors/fideloper.md | 5 +++++ content/authors/mattkingshott.md | 2 +- content/authors/mmartin_joo.md | 2 +- content/authors/mvpopuk.md | 5 +++++ content/threads/weekly-thread-2022-03.md | 11 +++++++++++ ...-is-very-powerful-yet-still-underutilized.md | 11 +++++++++++ ...ng-technique-add-getters-to-form-requests.md | 16 ++++++++++++++++ ...concurrent-requests-using-the-pool-method.md | 11 +++++++++++ ...-channel-is-fully-compatible-with-discord.md | 11 +++++++++++ ...specific-email-address-using-mailalwaysto.md | 13 +++++++++++++ ...e-to-periodically-delete-them-from-the-db.md | 15 +++++++++++++++ .../tips/mysql-has-a-blackhole-store-engine.md | 17 +++++++++++++++++ ...u-want-to-select-when-fetching-all-models.md | 15 +++++++++++++++ ...luding-shell-scripts-at-regular-intervals.md | 11 +++++++++++ .../tips/you-can-name-migrations-like-this.md | 11 +++++++++++ 17 files changed, 160 insertions(+), 3 deletions(-) create mode 100644 content/authors/aschmelyun.md create mode 100644 content/authors/fideloper.md create mode 100644 content/authors/mvpopuk.md create mode 100644 content/threads/weekly-thread-2022-03.md create mode 100644 content/tips/array-destructuring-in-php-is-very-powerful-yet-still-underutilized.md create mode 100644 content/tips/interesting-technique-add-getters-to-form-requests.md create mode 100644 content/tips/laravels-http-client-supports-concurrent-requests-using-the-pool-method.md create mode 100644 content/tips/laravels-slack-logging-channel-is-fully-compatible-with-discord.md create mode 100644 content/tips/make-laravel-send-all-emails-to-a-specific-email-address-using-mailalwaysto.md create mode 100644 content/tips/make-models-prunable-to-periodically-delete-them-from-the-db.md create mode 100644 content/tips/mysql-has-a-blackhole-store-engine.md create mode 100644 content/tips/specify-the-columns-you-want-to-select-when-fetching-all-models.md create mode 100644 content/tips/use-laravels-task-scheduler-to-run-cli-commands-including-shell-scripts-at-regular-intervals.md create mode 100644 content/tips/you-can-name-migrations-like-this.md diff --git a/content/authors/aschmelyun.md b/content/authors/aschmelyun.md new file mode 100644 index 0000000..64853ea --- /dev/null +++ b/content/authors/aschmelyun.md @@ -0,0 +1,5 @@ +--- +username: aschmelyun +name: 'Andrew Schmelyun' +avatar: 'https://pbs.twimg.com/profile_images/1079118209561841671/dI-xB5Az_normal.jpg' +--- diff --git a/content/authors/bhaidar.md b/content/authors/bhaidar.md index 5428751..03cc899 100644 --- a/content/authors/bhaidar.md +++ b/content/authors/bhaidar.md @@ -1,5 +1,5 @@ --- username: bhaidar -name: 'Bilal Haidar' +name: 'Bilal Haidar . Laravel Enthusiast' avatar: 'https://pbs.twimg.com/profile_images/1381347341400215552/LvVOFV9__normal.jpg' --- diff --git a/content/authors/fideloper.md b/content/authors/fideloper.md new file mode 100644 index 0000000..c8b1e29 --- /dev/null +++ b/content/authors/fideloper.md @@ -0,0 +1,5 @@ +--- +username: fideloper +name: 'Chris Fidao' +avatar: 'https://pbs.twimg.com/profile_images/2256212126/fideloper_normal.jpg' +--- diff --git a/content/authors/mattkingshott.md b/content/authors/mattkingshott.md index 63c9640..e3cc42c 100644 --- a/content/authors/mattkingshott.md +++ b/content/authors/mattkingshott.md @@ -1,5 +1,5 @@ --- username: mattkingshott -name: 'Matt Kingshott πŸš€' +name: 'Matt Kingshott 🏝' avatar: 'https://pbs.twimg.com/profile_images/1444979706571415564/toC9_E-T_normal.jpg' --- diff --git a/content/authors/mmartin_joo.md b/content/authors/mmartin_joo.md index c8b792e..b29d399 100644 --- a/content/authors/mmartin_joo.md +++ b/content/authors/mmartin_joo.md @@ -1,5 +1,5 @@ --- username: mmartin_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' --- diff --git a/content/authors/mvpopuk.md b/content/authors/mvpopuk.md new file mode 100644 index 0000000..83f8a30 --- /dev/null +++ b/content/authors/mvpopuk.md @@ -0,0 +1,5 @@ +--- +username: mvpopuk +name: 'Marian Pop 🐘' +avatar: 'https://pbs.twimg.com/profile_images/1470871614594113537/C3AsiJLb_normal.jpg' +--- diff --git a/content/threads/weekly-thread-2022-03.md b/content/threads/weekly-thread-2022-03.md new file mode 100644 index 0000000..f0c5bc0 --- /dev/null +++ b/content/threads/weekly-thread-2022-03.md @@ -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 🧡 \ No newline at end of file diff --git a/content/tips/array-destructuring-in-php-is-very-powerful-yet-still-underutilized.md b/content/tips/array-destructuring-in-php-is-very-powerful-yet-still-underutilized.md new file mode 100644 index 0000000..5c09de7 --- /dev/null +++ b/content/tips/array-destructuring-in-php-is-very-powerful-yet-still-underutilized.md @@ -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 \ No newline at end of file diff --git a/content/tips/interesting-technique-add-getters-to-form-requests.md b/content/tips/interesting-technique-add-getters-to-form-requests.md new file mode 100644 index 0000000..0b375b3 --- /dev/null +++ b/content/tips/interesting-technique-add-getters-to-form-requests.md @@ -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 \ No newline at end of file diff --git a/content/tips/laravels-http-client-supports-concurrent-requests-using-the-pool-method.md b/content/tips/laravels-http-client-supports-concurrent-requests-using-the-pool-method.md new file mode 100644 index 0000000..6e85764 --- /dev/null +++ b/content/tips/laravels-http-client-supports-concurrent-requests-using-the-pool-method.md @@ -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. \ No newline at end of file diff --git a/content/tips/laravels-slack-logging-channel-is-fully-compatible-with-discord.md b/content/tips/laravels-slack-logging-channel-is-fully-compatible-with-discord.md new file mode 100644 index 0000000..8ac4a91 --- /dev/null +++ b/content/tips/laravels-slack-logging-channel-is-fully-compatible-with-discord.md @@ -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! \ No newline at end of file diff --git a/content/tips/make-laravel-send-all-emails-to-a-specific-email-address-using-mailalwaysto.md b/content/tips/make-laravel-send-all-emails-to-a-specific-email-address-using-mailalwaysto.md new file mode 100644 index 0000000..7c9da07 --- /dev/null +++ b/content/tips/make-laravel-send-all-emails-to-a-specific-email-address-using-mailalwaysto.md @@ -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! \ No newline at end of file diff --git a/content/tips/make-models-prunable-to-periodically-delete-them-from-the-db.md b/content/tips/make-models-prunable-to-periodically-delete-them-from-the-db.md new file mode 100644 index 0000000..0417d57 --- /dev/null +++ b/content/tips/make-models-prunable-to-periodically-delete-them-from-the-db.md @@ -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: \ No newline at end of file diff --git a/content/tips/mysql-has-a-blackhole-store-engine.md b/content/tips/mysql-has-a-blackhole-store-engine.md new file mode 100644 index 0000000..8bd22ee --- /dev/null +++ b/content/tips/mysql-has-a-blackhole-store-engine.md @@ -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.... \ No newline at end of file diff --git a/content/tips/specify-the-columns-you-want-to-select-when-fetching-all-models.md b/content/tips/specify-the-columns-you-want-to-select-when-fetching-all-models.md new file mode 100644 index 0000000..204a119 --- /dev/null +++ b/content/tips/specify-the-columns-you-want-to-select-when-fetching-all-models.md @@ -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 \ No newline at end of file diff --git a/content/tips/use-laravels-task-scheduler-to-run-cli-commands-including-shell-scripts-at-regular-intervals.md b/content/tips/use-laravels-task-scheduler-to-run-cli-commands-including-shell-scripts-at-regular-intervals.md new file mode 100644 index 0000000..2be5bcc --- /dev/null +++ b/content/tips/use-laravels-task-scheduler-to-run-cli-commands-including-shell-scripts-at-regular-intervals.md @@ -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. \ No newline at end of file diff --git a/content/tips/you-can-name-migrations-like-this.md b/content/tips/you-can-name-migrations-like-this.md new file mode 100644 index 0000000..e8c4951 --- /dev/null +++ b/content/tips/you-can-name-migrations-like-this.md @@ -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? \ No newline at end of file