From c9fdb7c5cd71de793ba2cfc4a5729e7d3ab7b3fa Mon Sep 17 00:00:00 2001 From: lukinovec Date: Thu, 17 Feb 2022 11:16:11 +0100 Subject: [PATCH] Weekly thread #5 --- content/authors/AshAllenDesign.md | 2 +- content/authors/MikeVILT.md | 5 +++++ content/authors/asantibanez.md | 5 +++++ content/authors/freekmurze.md | 2 +- content/authors/jasonlbeggs.md | 5 +++++ content/threads/weekly-thread-2022-07.md | 13 +++++++++++++ ...laravel-9-you-can-use-str-instead-of-strof.md | 11 +++++++++++ ...tomatically-bind-route-parameters-to-enums.md | 13 +++++++++++++ ...-descriptors-and-implementations-as-orders.md | 15 +++++++++++++++ ...ontainer-bindings-using-the-bindings-array.md | 16 ++++++++++++++++ ...icy-helper-to-resolve-a-policy-for-a-model.md | 13 +++++++++++++ ...can-skip-transformrequests-type-middleware.md | 15 +++++++++++++++ ...blade-directive-to-generate-checked-markup.md | 15 +++++++++++++++ 13 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 content/authors/MikeVILT.md create mode 100644 content/authors/asantibanez.md create mode 100644 content/authors/jasonlbeggs.md create mode 100644 content/threads/weekly-thread-2022-07.md create mode 100644 content/tips/in-laravel-9-you-can-use-str-instead-of-strof.md create mode 100644 content/tips/laravel-9-can-automatically-bind-route-parameters-to-enums.md create mode 100644 content/tips/name-contracts-as-descriptors-and-implementations-as-orders.md create mode 100644 content/tips/specify-container-bindings-using-the-bindings-array.md create mode 100644 content/tips/use-the-policy-helper-to-resolve-a-policy-for-a-model.md create mode 100644 content/tips/you-can-skip-transformrequests-type-middleware.md create mode 100644 content/tips/you-can-use-the-at-checked-blade-directive-to-generate-checked-markup.md 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/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/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/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/threads/weekly-thread-2022-07.md b/content/threads/weekly-thread-2022-07.md new file mode 100644 index 0000000..2b4b236 --- /dev/null +++ b/content/threads/weekly-thread-2022-07.md @@ -0,0 +1,13 @@ +--- +slug: weekly-thread-2022-07 +title: 'Weekly thread #07 of 2022' +tweet_id: '1494019542648901632' +author_username: archtechx +created_at: 2022-02-17T10:14:38+00:00 +links: { } +--- +🔥 Last week's code tips for Laravel developers + +A weekly thread 🧵 + +https://twitter.com/archtechx/status/1493663801715081221 \ 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..66791f5 --- /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-07 +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 🔥 \ No newline at end of file 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..07cc8d9 --- /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-07 +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: \ 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..5234fda --- /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-07 +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 \ No newline at end of file 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..cffbaf4 --- /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-07 +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 \ 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..9f6878f --- /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-07 +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. 💪 \ No newline at end of file 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..91a3a22 --- /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-07 +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 \ No newline at end of file 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..50541c0 --- /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-07 +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 \ No newline at end of file