mirror of
https://github.com/archtechx/laravel-tips.git
synced 2025-12-12 13:24:03 +00:00
Weekly thread #5
This commit is contained in:
parent
e907eba3dd
commit
c9fdb7c5cd
13 changed files with 128 additions and 2 deletions
|
|
@ -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 🔥
|
||||
|
|
@ -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:
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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. 💪
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue