1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 05:14:04 +00:00

Weekly thread #5

This commit is contained in:
lukinovec 2022-02-17 11:16:11 +01:00
parent e907eba3dd
commit c9fdb7c5cd
13 changed files with 128 additions and 2 deletions

View file

@ -1,5 +1,5 @@
--- ---
username: AshAllenDesign username: AshAllenDesign
name: 'Ash Allen'
avatar: 'https://pbs.twimg.com/profile_images/1396951805775466501/FSQQmSCQ_normal.jpg' avatar: 'https://pbs.twimg.com/profile_images/1396951805775466501/FSQQmSCQ_normal.jpg'
name: 'Ash Allen 🚀'
--- ---

View file

@ -0,0 +1,5 @@
---
username: MikeVILT
name: Mike
avatar: 'https://pbs.twimg.com/profile_images/1488516571073024001/t4KUs74i_normal.jpg'
---

View file

@ -0,0 +1,5 @@
---
username: asantibanez
name: 'Andrés Santibáñez'
avatar: 'https://pbs.twimg.com/profile_images/1003126488957321218/d-e02mzF_normal.jpg'
---

View file

@ -1,5 +1,5 @@
--- ---
username: freekmurze username: freekmurze
avatar: 'https://pbs.twimg.com/profile_images/1492514213381746692/DARB_SUs_normal.jpg'
name: 'Freek Van der Herten 🔭' name: 'Freek Van der Herten 🔭'
avatar: 'https://pbs.twimg.com/profile_images/1433390470965735424/f5UiMISj_normal.jpg'
--- ---

View file

@ -0,0 +1,5 @@
---
username: jasonlbeggs
name: 'Jason Beggs'
avatar: 'https://pbs.twimg.com/profile_images/1391946980960743425/xi3nDA3k_normal.jpg'
---

View file

@ -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

View file

@ -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 🔥

View file

@ -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:

View file

@ -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

View file

@ -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

View file

@ -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. 💪

View file

@ -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

View file

@ -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