diff --git a/app/Console/Commands/WeeklyThread.php b/app/Console/Commands/WeeklyThread.php index fe1214b..0ea0710 100644 --- a/app/Console/Commands/WeeklyThread.php +++ b/app/Console/Commands/WeeklyThread.php @@ -39,6 +39,7 @@ class WeeklyThread extends Command 'tweet_id' => $id, 'author_username' => 'archtechx', 'content' => $tweet->text, + 'created_at' => $tweet->created_at, ]); while ($answer = $this->ask('Add tweet? Paste URL', 'no')) { diff --git a/content/authors/AshAllenDesign.md b/content/authors/AshAllenDesign.md index 783400a..aa96074 100644 --- a/content/authors/AshAllenDesign.md +++ b/content/authors/AshAllenDesign.md @@ -1,5 +1,5 @@ --- username: AshAllenDesign -name: 'Ash Allen' avatar: 'https://pbs.twimg.com/profile_images/1396951805775466501/FSQQmSCQ_normal.jpg' +name: 'Ash Allen 🚀' --- diff --git a/content/authors/JackEllis.md b/content/authors/JackEllis.md new file mode 100644 index 0000000..f9bb9e8 --- /dev/null +++ b/content/authors/JackEllis.md @@ -0,0 +1,5 @@ +--- +username: JackEllis +name: 'Jack Ellis' +avatar: 'https://pbs.twimg.com/profile_images/989296839194173440/ZRsVtbV5_normal.jpg' +--- diff --git a/content/authors/MikeVILT.md b/content/authors/MikeVILT.md new file mode 100644 index 0000000..01e7ae8 --- /dev/null +++ b/content/authors/MikeVILT.md @@ -0,0 +1,5 @@ +--- +username: MikeVILT +name: Mike +avatar: 'https://pbs.twimg.com/profile_images/1488516571073024001/t4KUs74i_normal.jpg' +--- diff --git a/content/authors/Sileence.md b/content/authors/Sileence.md new file mode 100644 index 0000000..3aa0a57 --- /dev/null +++ b/content/authors/Sileence.md @@ -0,0 +1,5 @@ +--- +username: Sileence +name: 'Duilio Palacios' +avatar: 'https://pbs.twimg.com/profile_images/916349154951081984/2rJdpjIi_normal.jpg' +--- diff --git a/content/authors/aarondfrancis.md b/content/authors/aarondfrancis.md index 8516eff..db4fab4 100644 --- a/content/authors/aarondfrancis.md +++ b/content/authors/aarondfrancis.md @@ -1,5 +1,5 @@ --- username: aarondfrancis +avatar: 'https://pbs.twimg.com/profile_images/1492165477161914369/bXZG72Li_normal.jpg' name: 'Aaron Francis' -avatar: 'https://pbs.twimg.com/profile_images/1433075605784997889/-Smrc71W_normal.jpg' --- diff --git a/content/authors/alanrezende.md b/content/authors/alanrezende.md new file mode 100644 index 0000000..a23acc0 --- /dev/null +++ b/content/authors/alanrezende.md @@ -0,0 +1,5 @@ +--- +username: alanrezende +name: 'Alan Rezende' +avatar: 'https://pbs.twimg.com/profile_images/1404889748896993288/R7HpEXS9_normal.jpg' +--- diff --git a/content/authors/asantibanez.md b/content/authors/asantibanez.md new file mode 100644 index 0000000..63ea829 --- /dev/null +++ b/content/authors/asantibanez.md @@ -0,0 +1,5 @@ +--- +username: asantibanez +name: 'Andrés Santibáñez' +avatar: 'https://pbs.twimg.com/profile_images/1003126488957321218/d-e02mzF_normal.jpg' +--- diff --git a/content/authors/brendt_gd.md b/content/authors/brendt_gd.md new file mode 100644 index 0000000..2c2e246 --- /dev/null +++ b/content/authors/brendt_gd.md @@ -0,0 +1,5 @@ +--- +username: brendt_gd +name: Brent +avatar: 'https://pbs.twimg.com/profile_images/1425316325845504000/XEnr-h2a_normal.png' +--- diff --git a/content/authors/cosmeescobedo.md b/content/authors/cosmeescobedo.md new file mode 100644 index 0000000..1612bde --- /dev/null +++ b/content/authors/cosmeescobedo.md @@ -0,0 +1,5 @@ +--- +username: cosmeescobedo +name: 'Cosme Escobedo' +avatar: 'https://pbs.twimg.com/profile_images/1491156731203710979/T0DNLMns_normal.jpg' +--- diff --git a/content/authors/freekmurze.md b/content/authors/freekmurze.md index ea4797c..902ca77 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' name: 'Freek Van der Herten 🔭' -avatar: 'https://pbs.twimg.com/profile_images/1433390470965735424/f5UiMISj_normal.jpg' --- diff --git a/content/authors/jasonlbeggs.md b/content/authors/jasonlbeggs.md new file mode 100644 index 0000000..8812451 --- /dev/null +++ b/content/authors/jasonlbeggs.md @@ -0,0 +1,5 @@ +--- +username: jasonlbeggs +name: 'Jason Beggs' +avatar: 'https://pbs.twimg.com/profile_images/1391946980960743425/xi3nDA3k_normal.jpg' +--- diff --git a/content/authors/warsh33p.md b/content/authors/warsh33p.md new file mode 100644 index 0000000..e03460a --- /dev/null +++ b/content/authors/warsh33p.md @@ -0,0 +1,5 @@ +--- +username: warsh33p +name: 'Kai Sassnowski 🥔' +avatar: 'https://pbs.twimg.com/profile_images/1471470755355443210/pCy5acDI_normal.jpg' +--- diff --git a/content/threads/weekly-thread-2022-05.md b/content/threads/weekly-thread-2022-05.md new file mode 100644 index 0000000..6027dc2 --- /dev/null +++ b/content/threads/weekly-thread-2022-05.md @@ -0,0 +1,11 @@ +--- +slug: weekly-thread-2022-05 +title: 'Weekly thread #05 of 2022' +tweet_id: '1489620159585153026' +author_username: archtechx +created_at: 2022-02-04T21:42:06+00:00 +links: { } +--- +🔥 This week's code tips for Laravel developers + +A weekly thread 🧵 diff --git a/content/threads/weekly-thread-2022-06.md b/content/threads/weekly-thread-2022-06.md new file mode 100644 index 0000000..2d7aa62 --- /dev/null +++ b/content/threads/weekly-thread-2022-06.md @@ -0,0 +1,13 @@ +--- +slug: weekly-thread-2022-06 +title: 'Weekly thread #06 of 2022' +tweet_id: '1494019542648901632' +author_username: archtechx +created_at: 2022-02-16T18:44:38+00:00 +links: { } +--- +🔥 Last week's code tips for Laravel developers + +A weekly thread 🧵 + +https://twitter.com/archtechx/status/1493663801715081221 diff --git a/content/threads/weekly-thread-2022-07.md b/content/threads/weekly-thread-2022-07.md new file mode 100644 index 0000000..19de0b4 --- /dev/null +++ b/content/threads/weekly-thread-2022-07.md @@ -0,0 +1,11 @@ +--- +slug: weekly-thread-2022-07 +title: 'Weekly thread #07 of 2022' +tweet_id: '1495414929053995012' +author_username: archtechx +created_at: 2022-02-20T15:07:57+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/in-laravel-9-you-can-use-str-instead-of-strof.md b/content/tips/in-laravel-9-you-can-use-str-instead-of-strof.md new file mode 100644 index 0000000..65935cb --- /dev/null +++ b/content/tips/in-laravel-9-you-can-use-str-instead-of-strof.md @@ -0,0 +1,11 @@ +--- +title: 'In Laravel 9, you can use str() instead of Str::of()' +tweet_id: '1494019557249335296' +thread_slug: weekly-thread-2022-06 +author_username: jasonlbeggs +images: + - 'https://pbs.twimg.com/media/FLKjhn4XMAIZqNI.png' +created_at: 2022-02-16T18:43:14+00:00 +slug: in-laravel-9-you-can-use-str-instead-of-strof +--- +The `str` helper in @laravelphp v9 is 🔥 diff --git a/content/tips/laravel-9-can-automatically-bind-route-parameters-to-enums.md b/content/tips/laravel-9-can-automatically-bind-route-parameters-to-enums.md new file mode 100644 index 0000000..03c4486 --- /dev/null +++ b/content/tips/laravel-9-can-automatically-bind-route-parameters-to-enums.md @@ -0,0 +1,13 @@ +--- +title: 'Laravel 9 can automatically bind route parameters to enums' +tweet_id: '1494019551310139392' +thread_slug: weekly-thread-2022-06 +author_username: mmartin_joo +images: + - 'https://pbs.twimg.com/media/FLJ8Gt_XsAM98uy.jpg' +created_at: 2022-02-16T18:43:13+00:00 +slug: laravel-9-can-automatically-bind-route-parameters-to-enums +--- +🔥Laravel 9 introduced enum route bindings! + +You can type-hint your enum and Laravel will cast the string value from the URL: diff --git a/content/tips/laravel-provides-a-fluent-class-as-a-universal-structure-for-array-data.md b/content/tips/laravel-provides-a-fluent-class-as-a-universal-structure-for-array-data.md new file mode 100644 index 0000000..3350219 --- /dev/null +++ b/content/tips/laravel-provides-a-fluent-class-as-a-universal-structure-for-array-data.md @@ -0,0 +1,17 @@ +--- +title: 'Laravel provides a `Fluent` class as a universal structure for array data' +tweet_id: '1489620180086902792' +thread_slug: weekly-thread-2022-05 +author_username: cerbero90 +images: + - 'https://pbs.twimg.com/media/FKcMWbwacAICnCw.png' +created_at: 2022-02-04T15:21:41+00:00 +slug: laravel-provides-a-fluent-class-as-a-universal-structure-for-array-data +--- +Fluent is a utility class provided by @laravelphp that lets us handle data fluently. + +Out of the box it can be turned into an array or JSON, it can act as an array and it's serializable as a JSON. + +It also gets and sets attributes dynamically and in a fluent way. + +#Laravel #PHP diff --git a/content/tips/match-statements-are-a-great-way-to-clean-up-code.md b/content/tips/match-statements-are-a-great-way-to-clean-up-code.md new file mode 100644 index 0000000..b1c7f7d --- /dev/null +++ b/content/tips/match-statements-are-a-great-way-to-clean-up-code.md @@ -0,0 +1,15 @@ +--- +title: 'match() statements are a great way to clean up code' +tweet_id: '1489620168233734144' +thread_slug: weekly-thread-2022-05 +author_username: cerbero90 +images: + - 'https://pbs.twimg.com/media/FKqzQ68aMAAqGdX.png' +created_at: 2022-02-04T15:21:38+00:00 +slug: match-statements-are-a-great-way-to-clean-up-code +--- +Match offers such a compact and clean syntax compared to its PHP alternatives 🌈 + +It can make our code way more readable and concise 💅 + +#PHP diff --git a/content/tips/move-tests-to-separate-test-suites.md b/content/tips/move-tests-to-separate-test-suites.md new file mode 100644 index 0000000..b553d12 --- /dev/null +++ b/content/tips/move-tests-to-separate-test-suites.md @@ -0,0 +1,11 @@ +--- +title: 'Move tests to separate test suites' +tweet_id: '1495414937757253636' +thread_slug: weekly-thread-2022-07 +author_username: JackEllis +images: + - 'https://pbs.twimg.com/media/FLVuSJRVQAEQffe.jpg' +created_at: 2022-02-20T15:07:59+00:00 +slug: move-tests-to-separate-test-suites +--- +My Laravel tip of the day. If you're running slow tests that need to hit a third party API, you can break them out of your Features directory and put them in a dedicated test suite (e.g. External). Then you can run "phpunit --testsuite Feature", and your External tests won't run. \ No newline at end of file diff --git a/content/tips/name-contracts-as-descriptors-and-implementations-as-orders.md b/content/tips/name-contracts-as-descriptors-and-implementations-as-orders.md new file mode 100644 index 0000000..6a266af --- /dev/null +++ b/content/tips/name-contracts-as-descriptors-and-implementations-as-orders.md @@ -0,0 +1,15 @@ +--- +title: 'Name contracts as descriptors and implementations as orders' +tweet_id: '1494019563490402305' +thread_slug: weekly-thread-2022-06 +author_username: MikeVILT +images: + - 'https://pbs.twimg.com/media/FLKZjZbXMAQ18WD.jpg' +created_at: 2022-02-16T18:43:16+00:00 +slug: name-contracts-as-descriptors-and-implementations-as-orders +--- +A great tip from Luke @LukeDowning19, + +"Name contracts as descriptions and implementations as orders" + +#laracon diff --git a/content/tips/specify-container-bindings-using-the-bindings-array.md b/content/tips/specify-container-bindings-using-the-bindings-array.md new file mode 100644 index 0000000..37c2fa3 --- /dev/null +++ b/content/tips/specify-container-bindings-using-the-bindings-array.md @@ -0,0 +1,16 @@ +--- +title: 'Specify container bindings using the $bindings array' +tweet_id: '1494019548374126594' +thread_slug: weekly-thread-2022-06 +author_username: freekmurze +images: + - 'https://pbs.twimg.com/media/FLKZmOCWYAAq9Hd.jpg' +created_at: 2022-02-16T18:43:12+00:00 +slug: specify-container-bindings-using-the-bindings-array +--- +🔥 Cool tidbit I learned during @LukeDowning19 ’s talk. + +You can add a `$bindings` array to a service provider to bind things. + +https://laravel.com/docs/9.x/providers#the-bindings-and-singletons-properties +#laravel #php diff --git a/content/tips/use-comments-for-explaining-complex-logic.md b/content/tips/use-comments-for-explaining-complex-logic.md new file mode 100644 index 0000000..daf8662 --- /dev/null +++ b/content/tips/use-comments-for-explaining-complex-logic.md @@ -0,0 +1,11 @@ +--- +title: 'Use comments for explaining complex logic' +tweet_id: '1495414946556903424' +thread_slug: weekly-thread-2022-07 +author_username: brendt_gd +images: + - 'https://pbs.twimg.com/media/FLsw0t6XwAIe5aI.jpg' +created_at: 2022-02-20T15:08:01+00:00 +slug: use-comments-for-explaining-complex-logic +--- +Comments in code should be used with care. They should only be added when they add actual value to the programmer; which is why I style them in such a way that they "pop out", instead of them disappearing in the background. \ No newline at end of file diff --git a/content/tips/use-fakernumerify-to-create-strings-with-numbers-at-specific-places.md b/content/tips/use-fakernumerify-to-create-strings-with-numbers-at-specific-places.md new file mode 100644 index 0000000..f650916 --- /dev/null +++ b/content/tips/use-fakernumerify-to-create-strings-with-numbers-at-specific-places.md @@ -0,0 +1,11 @@ +--- +title: 'Use Faker::numerify() to create strings with numbers at specific places' +tweet_id: '1495414931788746755' +thread_slug: weekly-thread-2022-07 +author_username: SteveTheBauman +images: + - 'https://pbs.twimg.com/media/FLkESRpXIAwj769.jpg' +created_at: 2022-02-20T15:07:57+00:00 +slug: use-fakernumerify-to-create-strings-with-numbers-at-specific-places +--- +A quick one that I *always* forget about -- Faker::numerify, allowing you to generate numeric data in a specific pattern 👌👏 \ No newline at end of file diff --git a/content/tips/use-the-policy-helper-to-resolve-a-policy-for-a-model.md b/content/tips/use-the-policy-helper-to-resolve-a-policy-for-a-model.md new file mode 100644 index 0000000..aad8797 --- /dev/null +++ b/content/tips/use-the-policy-helper-to-resolve-a-policy-for-a-model.md @@ -0,0 +1,13 @@ +--- +title: 'Use the policy() helper to resolve a policy for a model' +tweet_id: '1494019545446567939' +thread_slug: weekly-thread-2022-06 +author_username: asantibanez +images: + - 'https://pbs.twimg.com/media/FLNAs-bXIAExJxr.jpg' +created_at: 2022-02-16T18:43:11+00:00 +slug: use-the-policy-helper-to-resolve-a-policy-for-a-model +--- +TIL about @laravelphp policy() helper. Give it a model and it will resolve the policy for you. + +Very useful when testing policies behavior. 💪 diff --git a/content/tips/you-can-add-this-tailwind-plugin-to-generate-child-selector-variants.md b/content/tips/you-can-add-this-tailwind-plugin-to-generate-child-selector-variants.md new file mode 100644 index 0000000..b0e3d99 --- /dev/null +++ b/content/tips/you-can-add-this-tailwind-plugin-to-generate-child-selector-variants.md @@ -0,0 +1,11 @@ +--- +title: 'You can add this Tailwind plugin to generate child-selector variants' +tweet_id: '1489620177071210497' +thread_slug: weekly-thread-2022-05 +author_username: warsh33p +images: + - 'https://pbs.twimg.com/media/FKaHaf9XsAQzC_0.jpg' +created_at: 2022-02-04T15:21:40+00:00 +slug: you-can-add-this-tailwind-plugin-to-generate-child-selector-variants +--- +🔥 Since I’m having to deal with a lot of generated markup recently, this small child-selector plugin for Tailwind has been a life saver. diff --git a/content/tips/you-can-conditionally-skip-scheduled-jobs.md b/content/tips/you-can-conditionally-skip-scheduled-jobs.md new file mode 100644 index 0000000..aea07f1 --- /dev/null +++ b/content/tips/you-can-conditionally-skip-scheduled-jobs.md @@ -0,0 +1,11 @@ +--- +title: 'You can conditionally skip() scheduled jobs' +tweet_id: '1495414940684804100' +thread_slug: weekly-thread-2022-07 +author_username: cosmeescobedo +images: + - 'https://pbs.twimg.com/media/FL2KtKzVgAABGiG.jpg' +created_at: 2022-02-20T15:07:59+00:00 +slug: you-can-conditionally-skip-scheduled-jobs +--- +🔥 #Laravel the skip method in scheduler \ No newline at end of file diff --git a/content/tips/you-can-disable-lazy-loading-using-modelpreventlazyloading.md b/content/tips/you-can-disable-lazy-loading-using-modelpreventlazyloading.md new file mode 100644 index 0000000..2904087 --- /dev/null +++ b/content/tips/you-can-disable-lazy-loading-using-modelpreventlazyloading.md @@ -0,0 +1,11 @@ +--- +title: 'You can disable lazy loading using Model::preventLazyLoading()' +tweet_id: '1489620165201330177' +thread_slug: weekly-thread-2022-05 +author_username: mattkingshott +images: + - 'https://pbs.twimg.com/media/FKlnRQ_XwAUqAxB.jpg' +created_at: 2022-02-04T15:21:37+00:00 +slug: you-can-disable-lazy-loading-using-modelpreventlazyloading +--- +🔥 #Laravel Tip: Protect your database from the dangers of lazy loading by disabling it in your Laravel app. You can also customise how violations are handled, which is perfect for models outside of your control e.g. within packages. diff --git a/content/tips/you-can-replace-laravels-stubs-to-customize-files-generated-using-artisan-commands.md b/content/tips/you-can-replace-laravels-stubs-to-customize-files-generated-using-artisan-commands.md new file mode 100644 index 0000000..839b843 --- /dev/null +++ b/content/tips/you-can-replace-laravels-stubs-to-customize-files-generated-using-artisan-commands.md @@ -0,0 +1,11 @@ +--- +title: 'You can replace Laravel''s stubs to customize files generated using artisan commands' +tweet_id: '1489620183085768706' +thread_slug: weekly-thread-2022-05 +author_username: mattkingshott +images: + - 'https://pbs.twimg.com/media/FKbBGYpXIAACsW8.jpg' +created_at: 2022-02-04T15:21:42+00:00 +slug: you-can-replace-laravels-stubs-to-customize-files-generated-using-artisan-commands +--- +🔥 #Laravel Tip: If you find yourself constantly making changes to new files generated by Artisan's 'make' commands, then consider publishing the stubs and creating your own defaults. It can be a real time saver: diff --git a/content/tips/you-can-skip-transformrequests-type-middleware.md b/content/tips/you-can-skip-transformrequests-type-middleware.md new file mode 100644 index 0000000..eec8e6c --- /dev/null +++ b/content/tips/you-can-skip-transformrequests-type-middleware.md @@ -0,0 +1,15 @@ +--- +title: 'You can skip() TransformRequests-type middleware' +tweet_id: '1494019554304880641' +thread_slug: weekly-thread-2022-06 +author_username: pascalbaljet +images: + - 'https://pbs.twimg.com/media/FKwygqPWQAMRaTr.jpg' +created_at: 2022-02-16T18:43:13+00:00 +slug: you-can-skip-transformrequests-type-middleware +--- +💡 As of @laravelphp v8.36.0, you can skip 'TransformRequests' middlewares by registering a callback. + +For example, you can use it on 'TrimStrings' and 'ConvertEmptyStringsToNull'. + +#Laravel #PHP #webdev diff --git a/content/tips/you-can-swap-multiple-keywords-in-a-string-using-this-macro.md b/content/tips/you-can-swap-multiple-keywords-in-a-string-using-this-macro.md new file mode 100644 index 0000000..d4e9797 --- /dev/null +++ b/content/tips/you-can-swap-multiple-keywords-in-a-string-using-this-macro.md @@ -0,0 +1,13 @@ +--- +title: 'You can swap multiple keywords in a string using this macro' +tweet_id: '1489620174093176833' +thread_slug: weekly-thread-2022-05 +author_username: aarondfrancis +images: + - 'https://pbs.twimg.com/media/FKd_FZRXsAEgBjK.jpg' +created_at: 2022-02-04T15:21:39+00:00 +slug: you-can-swap-multiple-keywords-in-a-string-using-this-macro +--- +This is one of those macros I carry around from project to project. + +Super clear, super easy, nice little life improvement. diff --git a/content/tips/you-can-track-logins-and-logouts-for-auditing-purposes-using-laravels-native-auth-events.md b/content/tips/you-can-track-logins-and-logouts-for-auditing-purposes-using-laravels-native-auth-events.md new file mode 100644 index 0000000..cfa01ec --- /dev/null +++ b/content/tips/you-can-track-logins-and-logouts-for-auditing-purposes-using-laravels-native-auth-events.md @@ -0,0 +1,11 @@ +--- +title: 'You can track logins and logouts for auditing purposes using Laravel''s native auth events' +tweet_id: '1489620171241050112' +thread_slug: weekly-thread-2022-05 +author_username: mattkingshott +images: + - 'https://pbs.twimg.com/media/FKlsjn1WQAU_Xg2.jpg' +created_at: 2022-02-04T15:21:39+00:00 +slug: you-can-track-logins-and-logouts-for-auditing-purposes-using-laravels-native-auth-events +--- +🔥 #Laravel Tip: Tracking logins and logouts for auditing or security purposes is incredibly easy thanks to Laravel’s login and logout events. Simply listen for them in a service provider and respond when they are fired. diff --git a/content/tips/you-can-use-the-at-checked-blade-directive-to-generate-checked-markup.md b/content/tips/you-can-use-the-at-checked-blade-directive-to-generate-checked-markup.md new file mode 100644 index 0000000..e6535a1 --- /dev/null +++ b/content/tips/you-can-use-the-at-checked-blade-directive-to-generate-checked-markup.md @@ -0,0 +1,15 @@ +--- +title: 'You can use the @checked Blade directive to generate checked="" markup' +tweet_id: '1494019560223096837' +thread_slug: weekly-thread-2022-06 +author_username: AshAllenDesign +images: + - 'https://pbs.twimg.com/media/FKwA95pWUAInwgf.jpg' +created_at: 2022-02-16T18:43:15+00:00 +slug: you-can-use-the-at-checked-blade-directive-to-generate-checked-markup +--- +🔥 In Laravel 9, you'll be able to use the cool new "checked" Blade directive. + +This is going to be a nice addition that we can use to clean up our Blade views a little bit + +#laravel #php diff --git a/content/tips/you-can-use-the-getcollection-and-setcollection-methods-on-the-paginator-to-interact-with-the-underlying-data.md b/content/tips/you-can-use-the-getcollection-and-setcollection-methods-on-the-paginator-to-interact-with-the-underlying-data.md new file mode 100644 index 0000000..91509ad --- /dev/null +++ b/content/tips/you-can-use-the-getcollection-and-setcollection-methods-on-the-paginator-to-interact-with-the-underlying-data.md @@ -0,0 +1,11 @@ +--- +title: 'You can use the getCollection() and setCollection() methods on the paginator to interact with the underlying data' +tweet_id: '1489620186109857800' +thread_slug: weekly-thread-2022-05 +author_username: alanrezende +images: + - 'https://pbs.twimg.com/media/FKngV3LWQAQcft4.png' +created_at: 2022-02-04T15:21:42+00:00 +slug: you-can-use-the-getcollection-and-setcollection-methods-on-the-paginator-to-interact-with-the-underlying-data +--- +🔥 #Laravel paginator tip: you can use getCollection and setCollection if you need to do something to the paginator underlying data. Trust me you'll know when you need this. diff --git a/content/tips/you-can-use-the-new-strtransliterate-helper-to-convert-a-string-to-its-closest-ascii-representation.md b/content/tips/you-can-use-the-new-strtransliterate-helper-to-convert-a-string-to-its-closest-ascii-representation.md new file mode 100644 index 0000000..436df03 --- /dev/null +++ b/content/tips/you-can-use-the-new-strtransliterate-helper-to-convert-a-string-to-its-closest-ascii-representation.md @@ -0,0 +1,13 @@ +--- +title: 'You can use the new Str::transliterate() helper to convert a string to its closest ASCII representation' +tweet_id: '1489620162357579778' +thread_slug: weekly-thread-2022-05 +author_username: freekmurze +images: + - 'https://pbs.twimg.com/media/FKmRs46XsAA85Bh.jpg' +created_at: 2022-02-04T15:21:37+00:00 +slug: you-can-use-the-new-strtransliterate-helper-to-convert-a-string-to-its-closest-ascii-representation +--- +Pretty cool string helper method +https://laravel-news.com/laravel-8-82-0 +#laravel #php diff --git a/content/tips/you-can-use-traits-inside-php-enums.md b/content/tips/you-can-use-traits-inside-php-enums.md new file mode 100644 index 0000000..e85e77e --- /dev/null +++ b/content/tips/you-can-use-traits-inside-php-enums.md @@ -0,0 +1,13 @@ +--- +title: 'You can use traits inside PHP enums' +tweet_id: '1495414934754136064' +thread_slug: weekly-thread-2022-07 +author_username: archtechx +images: + - 'https://pbs.twimg.com/media/FL_ee0mVgAUuD-u.jpg' +created_at: 2022-02-20T15:07:58+00:00 +slug: you-can-use-traits-inside-php-enums +--- +A few days ago, I learned that PHP enums can use traits + +It may seem like a massive anti-pattern, but it allows making enums actually awesome with this one trick 🔥 \ No newline at end of file diff --git a/content/tips/you-can-use-wherenumber-on-routes-instead-of-passing-a-regex-pattern-to-where.md b/content/tips/you-can-use-wherenumber-on-routes-instead-of-passing-a-regex-pattern-to-where.md new file mode 100644 index 0000000..37a3ec4 --- /dev/null +++ b/content/tips/you-can-use-wherenumber-on-routes-instead-of-passing-a-regex-pattern-to-where.md @@ -0,0 +1,11 @@ +--- +title: 'You can use whereNumber() on routes instead of passing a regex pattern to where()' +tweet_id: '1495414943612506113' +thread_slug: weekly-thread-2022-07 +author_username: Sileence +images: + - 'https://pbs.twimg.com/media/FLZ9iNEX0AcKQVD.jpg' +created_at: 2022-02-20T15:08:00+00:00 +slug: you-can-use-wherenumber-on-routes-instead-of-passing-a-regex-pattern-to-where +--- +I'm reading the Laravel 9 docs from scratch and TIL you can write your route restrictions in a more expressive way: \ No newline at end of file