From 0e34bd37795f6a0f6b67d0ca1d17565e79eba2c9 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Fri, 14 Jan 2022 19:18:35 +0100 Subject: [PATCH] Weekly thread #2 (#24) --- content/authors/AshAllenDesign.md | 5 +++++ content/authors/ecrmnn.md | 5 +++++ content/authors/marcelpociot.md | 2 +- content/threads/weekly-thread-2022-02.md | 11 +++++++++++ ...te-which-works-very-similarly-to-ltagt-tags.md | 11 +++++++++++ ...ext-and-render-methods-to-custom-exceptions.md | 11 +++++++++++ ...-instance-when-the-current-user-is-an-admin.md | 11 +++++++++++ ...ad-specific-scripts-only-in-production-mode.md | 11 +++++++++++ ...oquent-to-fetch-a-single-column-from-the-db.md | 11 +++++++++++ ...-can-provide-auto-complete-for-the-terminal.md | 15 +++++++++++++++ 10 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 content/authors/AshAllenDesign.md create mode 100644 content/authors/ecrmnn.md create mode 100644 content/threads/weekly-thread-2022-02.md create mode 100644 content/tips/form-elements-can-have-a-target-attribute-which-works-very-similarly-to-ltagt-tags.md create mode 100644 content/tips/you-can-add-the-context-and-render-methods-to-custom-exceptions.md create mode 100644 content/tips/you-can-use-at-includewhen-to-include-certain-blade-partials-when-some-condition-is-met-for-instance-when-the-current-user-is-an-admin.md create mode 100644 content/tips/you-can-use-the-at-production-blade-directive-to-load-specific-scripts-only-in-production-mode.md create mode 100644 content/tips/you-can-use-the-value-method-in-eloquent-to-fetch-a-single-column-from-the-db.md create mode 100644 content/tips/your-cli-commands-in-laravel-can-provide-auto-complete-for-the-terminal.md diff --git a/content/authors/AshAllenDesign.md b/content/authors/AshAllenDesign.md new file mode 100644 index 0000000..783400a --- /dev/null +++ b/content/authors/AshAllenDesign.md @@ -0,0 +1,5 @@ +--- +username: AshAllenDesign +name: 'Ash Allen' +avatar: 'https://pbs.twimg.com/profile_images/1396951805775466501/FSQQmSCQ_normal.jpg' +--- diff --git a/content/authors/ecrmnn.md b/content/authors/ecrmnn.md new file mode 100644 index 0000000..b31b42f --- /dev/null +++ b/content/authors/ecrmnn.md @@ -0,0 +1,5 @@ +--- +username: ecrmnn +name: 'Daniel Eckermann' +avatar: 'https://pbs.twimg.com/profile_images/1433834747411767306/rEA7K8oI_normal.jpg' +--- diff --git a/content/authors/marcelpociot.md b/content/authors/marcelpociot.md index bc21839..dcdcf0a 100644 --- a/content/authors/marcelpociot.md +++ b/content/authors/marcelpociot.md @@ -1,5 +1,5 @@ --- username: marcelpociot 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' --- diff --git a/content/threads/weekly-thread-2022-02.md b/content/threads/weekly-thread-2022-02.md new file mode 100644 index 0000000..5589ea9 --- /dev/null +++ b/content/threads/weekly-thread-2022-02.md @@ -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 \ No newline at end of file diff --git a/content/tips/form-elements-can-have-a-target-attribute-which-works-very-similarly-to-ltagt-tags.md b/content/tips/form-elements-can-have-a-target-attribute-which-works-very-similarly-to-ltagt-tags.md new file mode 100644 index 0000000..abcacc9 --- /dev/null +++ b/content/tips/form-elements-can-have-a-target-attribute-which-works-very-similarly-to-ltagt-tags.md @@ -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? \ No newline at end of file diff --git a/content/tips/you-can-add-the-context-and-render-methods-to-custom-exceptions.md b/content/tips/you-can-add-the-context-and-render-methods-to-custom-exceptions.md new file mode 100644 index 0000000..f1b8125 --- /dev/null +++ b/content/tips/you-can-add-the-context-and-render-methods-to-custom-exceptions.md @@ -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! ๐Ÿคฉ \ No newline at end of file diff --git a/content/tips/you-can-use-at-includewhen-to-include-certain-blade-partials-when-some-condition-is-met-for-instance-when-the-current-user-is-an-admin.md b/content/tips/you-can-use-at-includewhen-to-include-certain-blade-partials-when-some-condition-is-met-for-instance-when-the-current-user-is-an-admin.md new file mode 100644 index 0000000..066c845 --- /dev/null +++ b/content/tips/you-can-use-at-includewhen-to-include-certain-blade-partials-when-some-condition-is-met-for-instance-when-the-current-user-is-an-admin.md @@ -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. \ No newline at end of file diff --git a/content/tips/you-can-use-the-at-production-blade-directive-to-load-specific-scripts-only-in-production-mode.md b/content/tips/you-can-use-the-at-production-blade-directive-to-load-specific-scripts-only-in-production-mode.md new file mode 100644 index 0000000..37bef5a --- /dev/null +++ b/content/tips/you-can-use-the-at-production-blade-directive-to-load-specific-scripts-only-in-production-mode.md @@ -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 \ No newline at end of file diff --git a/content/tips/you-can-use-the-value-method-in-eloquent-to-fetch-a-single-column-from-the-db.md b/content/tips/you-can-use-the-value-method-in-eloquent-to-fetch-a-single-column-from-the-db.md new file mode 100644 index 0000000..cbd6ac2 --- /dev/null +++ b/content/tips/you-can-use-the-value-method-in-eloquent-to-fetch-a-single-column-from-the-db.md @@ -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! ๐Ÿ’…๐Ÿคฉ \ No newline at end of file diff --git a/content/tips/your-cli-commands-in-laravel-can-provide-auto-complete-for-the-terminal.md b/content/tips/your-cli-commands-in-laravel-can-provide-auto-complete-for-the-terminal.md new file mode 100644 index 0000000..fd392ef --- /dev/null +++ b/content/tips/your-cli-commands-in-laravel-can-provide-auto-complete-for-the-terminal.md @@ -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 \ No newline at end of file