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

Weekly thread #2

This commit is contained in:
lukinovec 2022-01-14 19:06:59 +01:00
parent 36a9c5eec0
commit a2d0b1ad30
10 changed files with 92 additions and 1 deletions

View file

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

View file

@ -0,0 +1,5 @@
---
username: ecrmnn
name: 'Daniel Eckermann'
avatar: 'https://pbs.twimg.com/profile_images/1433834747411767306/rEA7K8oI_normal.jpg'
---

View file

@ -1,5 +1,5 @@
--- ---
username: marcelpociot username: marcelpociot
name: 'Marcel Pociot 🧪' name: 'Marcel Pociot 🧪'
avatar: 'https://pbs.twimg.com/profile_images/1432253549984075778/JNGTD6wb_normal.jpg' avatar: 'https://pbs.twimg.com/profile_images/1467572011392245769/VDwu7_7w_normal.jpg'
--- ---

View file

@ -0,0 +1,11 @@
---
slug: weekly-thread-2022-02
title: 'Weekly thread #02 of 2022'
tweet_id: '1482036548921016321'
author_username: archtechx
created_at: 2022-01-14T18:06:24+00:00
links: { }
---
🔥 This week's code tips for Laravel developers
🧵 A weekly thread

View file

@ -0,0 +1,11 @@
---
title: 'Form elements can have a "target" attribute which works very similarly to <a> tags'
tweet_id: '1482036555883560961'
thread_slug: weekly-thread-2022-02
author_username: jbrooksuk
images:
- 'https://pbs.twimg.com/media/FI-ZzcDWQAED8P2.jpg'
created_at: 2022-01-14T17:07:04+00:00
slug: form-elements-can-have-a-target-attribute-which-works-very-similarly-to-ltagt-tags
---
Did you know that "form" elements can have a "target" attribute too?

View file

@ -0,0 +1,11 @@
---
title: 'You can add the context() and render() methods to custom exceptions'
tweet_id: '1482036568852348928'
thread_slug: weekly-thread-2022-02
author_username: SteveTheBauman
images:
- 'https://pbs.twimg.com/media/FI6OtPbXEAMoUWL.jpg'
created_at: 2022-01-14T17:07:07+00:00
slug: you-can-add-the-context-and-render-methods-to-custom-exceptions
---
If you're creating custom exceptions inside your Laravel application, you can add a "context()" method to provide additional data to be printed in the log, as well as a "render()" method to allow the exception to display its own view to the user. Super cool! 🤩

View file

@ -0,0 +1,11 @@
---
title: 'You can use @includeWhen to include certain Blade partials when some condition is met. For instance, when the current user is an admin'
tweet_id: '1482036560354676737'
thread_slug: weekly-thread-2022-02
author_username: marcelpociot
images:
- 'https://pbs.twimg.com/media/FI47GaYXMAI7SeA.jpg'
created_at: 2022-01-14T17:07:05+00:00
slug: you-can-use-at-includewhen-to-include-certain-blade-partials-when-some-condition-is-met-for-instance-when-the-current-user-is-an-admin
---
Make use of the built-in "includeWhen" and "includeUnless" directives to get rid of those ugly if conditions.

View file

@ -0,0 +1,11 @@
---
title: 'You can use the @production Blade directive to load specific scripts only in production mode'
tweet_id: '1482036552242892803'
thread_slug: weekly-thread-2022-02
author_username: ecrmnn
images:
- 'https://pbs.twimg.com/media/FI_vAnAWQAEddIH.jpg'
created_at: 2022-01-14T17:07:03+00:00
slug: you-can-use-the-at-production-blade-directive-to-load-specific-scripts-only-in-production-mode
---
The @.production blade directive makes it super easy to load e.g. Google Analytics or other stuff when your Laravel app is in production mode

View file

@ -0,0 +1,11 @@
---
title: 'You can use the value() method in Eloquent to fetch a single column from the DB'
tweet_id: '1482036550967853057'
thread_slug: weekly-thread-2022-02
author_username: SteveTheBauman
images:
- 'https://pbs.twimg.com/media/FJEgq7SXwAE5rpl.jpg'
created_at: 2022-01-14T17:07:03+00:00
slug: you-can-use-the-value-method-in-eloquent-to-fetch-a-single-column-from-the-db
---
Just learned about the Eloquent "value()" method from @amaelftah 💪. Eloquent make things so easy. Seems like there's shortcuts hiding everywhere, I love it! 💅🤩

View file

@ -0,0 +1,15 @@
---
title: 'Your CLI commands in Laravel can provide auto-complete for the terminal'
tweet_id: '1482036564746129410'
thread_slug: weekly-thread-2022-02
author_username: AshAllenDesign
images:
- 'https://pbs.twimg.com/media/FI-pr9tXEAURLrX.jpg'
created_at: 2022-01-14T17:07:06+00:00
slug: your-cli-commands-in-laravel-can-provide-auto-complete-for-the-terminal
---
Did you know that you can provide auto-complete hints for your commands in Laravel?
These can be pretty helpful in your internal CLI tools that you have in your projects 🚀
#laravel #php