From b41c692353678747147170a4ed8433ffb079568d Mon Sep 17 00:00:00 2001 From: lukinovec Date: Fri, 5 Nov 2021 17:12:37 +0100 Subject: [PATCH 1/2] Add new tips thread --- content/authors/AzizullahSamim.md | 5 +++++ content/authors/aarondfrancis.md | 5 +++++ content/authors/jbrooksuk.md | 5 +++++ content/authors/jessarchercodes.md | 5 +++++ content/authors/sharik_709.md | 5 +++++ content/authors/sky_0xs.md | 5 +++++ content/threads/weekly-thread-2021-44.md | 11 +++++++++++ ...-changing-a-value-in-the-fortify-config.md | 11 +++++++++++ ...ies-to-their-original-state-in-livewire.md | 14 ++++++++++++++ ...relations-can-improve-their-performance.md | 15 +++++++++++++++ ...es-in-laravel-even-outside-cli-commands.md | 11 +++++++++++ ...le-instances-without-passing-a-callback.md | 11 +++++++++++ ...o-use-dump-or-dd-in-your-short-closures.md | 11 +++++++++++ ...t-having-to-instantiate-an-entire-model.md | 12 ++++++++++++ ...st-if-the-queried-record-does-not-exist.md | 19 +++++++++++++++++++ 15 files changed, 145 insertions(+) create mode 100644 content/authors/AzizullahSamim.md create mode 100644 content/authors/aarondfrancis.md create mode 100644 content/authors/jbrooksuk.md create mode 100644 content/authors/jessarchercodes.md create mode 100644 content/authors/sharik_709.md create mode 100644 content/authors/sky_0xs.md create mode 100644 content/threads/weekly-thread-2021-44.md create mode 100644 content/tips/customize-the-page-that-users-are-redirected-to-after-registration-by-changing-a-value-in-the-fortify-config.md create mode 100644 content/tips/use-the-reset-method-to-reset-properties-to-their-original-state-in-livewire.md create mode 100644 content/tips/using-small-integers-instead-of-entire-class-strings-for-morph-relations-can-improve-their-performance.md create mode 100644 content/tips/you-can-create-text-based-tables-in-laravel-even-outside-cli-commands.md create mode 100644 content/tips/you-can-use-gtwhere-on-rule-instances-without-passing-a-callback.md create mode 100644 content/tips/you-can-use-ternary-operators-like-to-use-dump-or-dd-in-your-short-closures.md create mode 100644 content/tips/you-can-use-value-to-fetch-a-single-value-from-the-database-without-having-to-instantiate-an-entire-model.md create mode 100644 content/tips/you-can-use-valueorfail-to-fetch-a-value-from-the-database-or-abort-the-request-if-the-queried-record-does-not-exist.md diff --git a/content/authors/AzizullahSamim.md b/content/authors/AzizullahSamim.md new file mode 100644 index 0000000..d51d26b --- /dev/null +++ b/content/authors/AzizullahSamim.md @@ -0,0 +1,5 @@ +--- +username: AzizullahSamim +name: 'Azizullah Samim' +avatar: 'https://pbs.twimg.com/profile_images/1335270749775540225/TUHwxsQ3_normal.jpg' +--- diff --git a/content/authors/aarondfrancis.md b/content/authors/aarondfrancis.md new file mode 100644 index 0000000..8516eff --- /dev/null +++ b/content/authors/aarondfrancis.md @@ -0,0 +1,5 @@ +--- +username: aarondfrancis +name: 'Aaron Francis' +avatar: 'https://pbs.twimg.com/profile_images/1433075605784997889/-Smrc71W_normal.jpg' +--- diff --git a/content/authors/jbrooksuk.md b/content/authors/jbrooksuk.md new file mode 100644 index 0000000..9eb7692 --- /dev/null +++ b/content/authors/jbrooksuk.md @@ -0,0 +1,5 @@ +--- +username: jbrooksuk +name: 'James Brooks ' +avatar: 'https://pbs.twimg.com/profile_images/1450888833168560138/6LhKVmed_normal.jpg' +--- diff --git a/content/authors/jessarchercodes.md b/content/authors/jessarchercodes.md new file mode 100644 index 0000000..26617ff --- /dev/null +++ b/content/authors/jessarchercodes.md @@ -0,0 +1,5 @@ +--- +username: jessarchercodes +name: 'Jess Archer' +avatar: 'https://pbs.twimg.com/profile_images/1149493363470585858/2aa3eHfK_normal.png' +--- diff --git a/content/authors/sharik_709.md b/content/authors/sharik_709.md new file mode 100644 index 0000000..4f23f90 --- /dev/null +++ b/content/authors/sharik_709.md @@ -0,0 +1,5 @@ +--- +username: sharik_709 +name: 'Sharik Shaikh' +avatar: 'https://pbs.twimg.com/profile_images/1449051129845714947/XFQAdiQK_normal.jpg' +--- diff --git a/content/authors/sky_0xs.md b/content/authors/sky_0xs.md new file mode 100644 index 0000000..cc3a989 --- /dev/null +++ b/content/authors/sky_0xs.md @@ -0,0 +1,5 @@ +--- +username: sky_0xs +name: 'Oussama Sid' +avatar: 'https://pbs.twimg.com/profile_images/1405143897177694210/C-7sXUQ__normal.jpg' +--- diff --git a/content/threads/weekly-thread-2021-44.md b/content/threads/weekly-thread-2021-44.md new file mode 100644 index 0000000..906f6dc --- /dev/null +++ b/content/threads/weekly-thread-2021-44.md @@ -0,0 +1,11 @@ +--- +slug: weekly-thread-2021-44 +title: 'Weekly thread #44 of 2021' +tweet_id: '1456649610621902860' +author_username: archtechx +created_at: 2021-11-05T16:04:14+00:00 +links: { } +--- +🔥 This week's tips for Laravel developers + +Lots of great tweets this week, thanks to everyone for posting them! They're helpful to everyone in the community ❤️ \ No newline at end of file diff --git a/content/tips/customize-the-page-that-users-are-redirected-to-after-registration-by-changing-a-value-in-the-fortify-config.md b/content/tips/customize-the-page-that-users-are-redirected-to-after-registration-by-changing-a-value-in-the-fortify-config.md new file mode 100644 index 0000000..3255523 --- /dev/null +++ b/content/tips/customize-the-page-that-users-are-redirected-to-after-registration-by-changing-a-value-in-the-fortify-config.md @@ -0,0 +1,11 @@ +--- +title: 'Customize the page that users are redirected to after registration, by changing a value in the Fortify config' +tweet_id: '1456649619559968773' +thread_slug: weekly-thread-2021-44 +author_username: sharik_709 +images: + - 'https://pbs.twimg.com/media/FDGBGv8VEAA3JBZ.jpg' +created_at: 2021-11-05T15:48:27+00:00 +slug: customize-the-page-that-users-are-redirected-to-after-registration-by-changing-a-value-in-the-fortify-config +--- +When using Jetstream Fortify, If you would like to take the user to a different page after registration instead of the email verifying page. Then you could add an array inside `config/fortify.php` like shown below #Laravel \ No newline at end of file diff --git a/content/tips/use-the-reset-method-to-reset-properties-to-their-original-state-in-livewire.md b/content/tips/use-the-reset-method-to-reset-properties-to-their-original-state-in-livewire.md new file mode 100644 index 0000000..bc0dad8 --- /dev/null +++ b/content/tips/use-the-reset-method-to-reset-properties-to-their-original-state-in-livewire.md @@ -0,0 +1,14 @@ +--- +title: 'Use the reset() method to reset properties to their original state in Livewire' +tweet_id: '1456649620918992898' +thread_slug: weekly-thread-2021-44 +author_username: sky_0xs +images: + - 'https://pbs.twimg.com/media/FC-XoMFXEAAZGXM.jpg' +created_at: 2021-11-05T15:48:27+00:00 +slug: use-the-reset-method-to-reset-properties-to-their-original-state-in-livewire +--- +#Laravel Livewire Tip: +If you want to remove property values at once and make your code cleaner, you can use `$this->reset` method. + +Here is an example: \ No newline at end of file diff --git a/content/tips/using-small-integers-instead-of-entire-class-strings-for-morph-relations-can-improve-their-performance.md b/content/tips/using-small-integers-instead-of-entire-class-strings-for-morph-relations-can-improve-their-performance.md new file mode 100644 index 0000000..27e69b8 --- /dev/null +++ b/content/tips/using-small-integers-instead-of-entire-class-strings-for-morph-relations-can-improve-their-performance.md @@ -0,0 +1,15 @@ +--- +title: 'Using small integers instead of entire class strings for morph relations can improve their performance' +tweet_id: '1456649615571177476' +thread_slug: weekly-thread-2021-44 +author_username: aarondfrancis +images: + - 'https://pbs.twimg.com/media/FDR-ODWXMA0MA5L.jpg' +created_at: 2021-11-05T15:48:26+00:00 +slug: using-small-integers-instead-of-entire-class-strings-for-morph-relations-can-improve-their-performance +--- +When using Laravel morphs, you can eek out some extra performance by using small integers instead of strings for your morph types. + +Smaller, faster indexes for the database to manage! + +Especially useful for tables like comments or audits, which can be many millions of rows. \ No newline at end of file diff --git a/content/tips/you-can-create-text-based-tables-in-laravel-even-outside-cli-commands.md b/content/tips/you-can-create-text-based-tables-in-laravel-even-outside-cli-commands.md new file mode 100644 index 0000000..a6beb88 --- /dev/null +++ b/content/tips/you-can-create-text-based-tables-in-laravel-even-outside-cli-commands.md @@ -0,0 +1,11 @@ +--- +title: 'You can create text-based tables in Laravel even outside CLI commands' +tweet_id: '1456649616934404097' +thread_slug: weekly-thread-2021-44 +author_username: SteveTheBauman +images: + - 'https://pbs.twimg.com/media/FDR9jFzXsAICBd9.jpg' +created_at: 2021-11-05T15:48:26+00:00 +slug: you-can-create-text-based-tables-in-laravel-even-outside-cli-commands +--- +If you ever need to generate text-based tables for sending in text messages, outputting in console, or in logs, @symfony provides an awesome "Table" class, just for that! 💅 Such a cool utility! 🤩 \ No newline at end of file diff --git a/content/tips/you-can-use-gtwhere-on-rule-instances-without-passing-a-callback.md b/content/tips/you-can-use-gtwhere-on-rule-instances-without-passing-a-callback.md new file mode 100644 index 0000000..0ed67f0 --- /dev/null +++ b/content/tips/you-can-use-gtwhere-on-rule-instances-without-passing-a-callback.md @@ -0,0 +1,11 @@ +--- +title: 'You can use ->where() on Rule instances without passing a callback' +tweet_id: '1456649614300356615' +thread_slug: weekly-thread-2021-44 +author_username: jbrooksuk +images: + - 'https://pbs.twimg.com/media/FDDdhwiXEAIY4vZ.jpg' +created_at: 2021-11-05T15:48:25+00:00 +slug: you-can-use-gtwhere-on-rule-instances-without-passing-a-callback +--- +Did you know that you don't have to pass a function to Laravel's "where" method when using the Rule class? \ No newline at end of file diff --git a/content/tips/you-can-use-ternary-operators-like-to-use-dump-or-dd-in-your-short-closures.md b/content/tips/you-can-use-ternary-operators-like-to-use-dump-or-dd-in-your-short-closures.md new file mode 100644 index 0000000..eb81f42 --- /dev/null +++ b/content/tips/you-can-use-ternary-operators-like-to-use-dump-or-dd-in-your-short-closures.md @@ -0,0 +1,11 @@ +--- +title: 'You can use ternary operators like ?: to use dump() or dd() in your short closures' +tweet_id: '1456649618205261824' +thread_slug: weekly-thread-2021-44 +author_username: jessarchercodes +images: + - 'https://pbs.twimg.com/media/FDOw-QKUUAEbXLw.jpg' +created_at: 2021-11-05T15:48:26+00:00 +slug: you-can-use-ternary-operators-like-to-use-dump-or-dd-in-your-short-closures +--- +Do you hate re-writing short closures just to add temporary debugging code? \ No newline at end of file diff --git a/content/tips/you-can-use-value-to-fetch-a-single-value-from-the-database-without-having-to-instantiate-an-entire-model.md b/content/tips/you-can-use-value-to-fetch-a-single-value-from-the-database-without-having-to-instantiate-an-entire-model.md new file mode 100644 index 0000000..9167e90 --- /dev/null +++ b/content/tips/you-can-use-value-to-fetch-a-single-value-from-the-database-without-having-to-instantiate-an-entire-model.md @@ -0,0 +1,12 @@ +--- +title: 'You can use value() to fetch a single value from the database, without having to instantiate an entire model' +tweet_id: '1456649611796369411' +thread_slug: weekly-thread-2021-44 +author_username: AzizullahSamim +images: + - 'https://pbs.twimg.com/media/FDL2wc2XMAYoIXr.jpg' +created_at: 2021-11-05T15:48:25+00:00 +slug: you-can-use-value-to-fetch-a-single-value-from-the-database-without-having-to-instantiate-an-entire-model +--- +#Laravel Tip: +If you want a single value from a database table. \ No newline at end of file diff --git a/content/tips/you-can-use-valueorfail-to-fetch-a-value-from-the-database-or-abort-the-request-if-the-queried-record-does-not-exist.md b/content/tips/you-can-use-valueorfail-to-fetch-a-value-from-the-database-or-abort-the-request-if-the-queried-record-does-not-exist.md new file mode 100644 index 0000000..dcb9067 --- /dev/null +++ b/content/tips/you-can-use-valueorfail-to-fetch-a-value-from-the-database-or-abort-the-request-if-the-queried-record-does-not-exist.md @@ -0,0 +1,19 @@ +--- +title: 'You can use valueOrFail() to fetch a value from the database, or abort the request if the queried record does not exist' +tweet_id: '1456649612966576129' +thread_slug: weekly-thread-2021-44 +author_username: pascalbaljet +images: + - 'https://pbs.twimg.com/media/FC7vZ2oX0AIV4fG.jpg' +created_at: 2021-11-05T15:48:25+00:00 +slug: you-can-use-valueorfail-to-fetch-a-value-from-the-database-or-abort-the-request-if-the-queried-record-does-not-exist +--- +In the next blog posts, I'll cover Database and Eloquent improvements and new features in #Laravel 8.x. + +Here's a great little feature that got added in v8.60 🔥 + +PR: https://github.com/laravel/framework/pull/38707 + +Yesterday's post about Collections: https://protone.media/en/blog/a-look-at-new-features-and-improvements-since-the-original-laravel-80-release-collections + +#PHP #webdev #opensource \ No newline at end of file From 2888833865da2f1547cb131025142aa4e6550a2a Mon Sep 17 00:00:00 2001 From: lukinovec Date: Fri, 5 Nov 2021 17:13:26 +0100 Subject: [PATCH 2/2] Fix special character --- ...e-where-on-rule-instances-without-passing-a-callback.md} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename content/tips/{you-can-use-gtwhere-on-rule-instances-without-passing-a-callback.md => you-can-use-where-on-rule-instances-without-passing-a-callback.md} (58%) diff --git a/content/tips/you-can-use-gtwhere-on-rule-instances-without-passing-a-callback.md b/content/tips/you-can-use-where-on-rule-instances-without-passing-a-callback.md similarity index 58% rename from content/tips/you-can-use-gtwhere-on-rule-instances-without-passing-a-callback.md rename to content/tips/you-can-use-where-on-rule-instances-without-passing-a-callback.md index 0ed67f0..565e022 100644 --- a/content/tips/you-can-use-gtwhere-on-rule-instances-without-passing-a-callback.md +++ b/content/tips/you-can-use-where-on-rule-instances-without-passing-a-callback.md @@ -1,11 +1,11 @@ --- -title: 'You can use ->where() on Rule instances without passing a callback' +title: 'You can use ->where() on Rule instances without passing a callback' tweet_id: '1456649614300356615' thread_slug: weekly-thread-2021-44 author_username: jbrooksuk images: - 'https://pbs.twimg.com/media/FDDdhwiXEAIY4vZ.jpg' created_at: 2021-11-05T15:48:25+00:00 -slug: you-can-use-gtwhere-on-rule-instances-without-passing-a-callback +slug: you-can-use-where-on-rule-instances-without-passing-a-callback --- -Did you know that you don't have to pass a function to Laravel's "where" method when using the Rule class? \ No newline at end of file +Did you know that you don't have to pass a function to Laravel's "where" method when using the Rule class?