diff --git a/content/threads/weekly-thread-2022-31.md b/content/threads/weekly-thread-2022-31.md new file mode 100644 index 0000000..ebc819d --- /dev/null +++ b/content/threads/weekly-thread-2022-31.md @@ -0,0 +1,19 @@ +--- +slug: weekly-thread-2022-31 +title: 'Weekly thread #31 of 2022' +tweet_id: '1555543649751932928' +author_username: archtechx +created_at: 2022-08-05T13:18:01+00:00 +links: { } +--- +This week's news and code tips for Laravel developers include: + +🆕 Laravel 9.23 +📦 Haystack package +✨ Octane v1.3 released +🏢 Tailwind CSS job board +🍃 Termwind v1.14 released + +and more... + +Thread #132 \ No newline at end of file diff --git a/content/tips/you-can-manually-set-the-relation-of-a-model-using-setrelation-method.md b/content/tips/you-can-manually-set-the-relation-of-a-model-using-setrelation-method.md new file mode 100644 index 0000000..75abfd6 --- /dev/null +++ b/content/tips/you-can-manually-set-the-relation-of-a-model-using-setrelation-method.md @@ -0,0 +1,15 @@ +--- +title: 'You can manually set the relation of a model using `setRelation` method' +tweet_id: '1555543660678156288' +thread_slug: weekly-thread-2022-31 +author_username: freekmurze +images: + - 'https://pbs.twimg.com/media/FZUmDyfXkAY7qyU.jpg' +created_at: 2022-08-05T13:18:03+00:00 +slug: you-can-manually-set-the-relation-of-a-model-using-setrelation-method +--- +Eloquent’s `setRelation` is a very powerful method when used well. Here’s how I used it to solve a performance problem in @OhDearApp + +https://freek.dev/2311-increase-performance-by-using-eloquents-setrelation-method + +#laravel #php #performance \ No newline at end of file diff --git a/content/tips/you-can-provide-closures-into-the-default-value-in-laravels-config-helper.md b/content/tips/you-can-provide-closures-into-the-default-value-in-laravels-config-helper.md new file mode 100644 index 0000000..18b5baa --- /dev/null +++ b/content/tips/you-can-provide-closures-into-the-default-value-in-laravels-config-helper.md @@ -0,0 +1,11 @@ +--- +title: 'You can provide closures into the $default value in Laravel''s config helper' +tweet_id: '1555543655087099905' +thread_slug: weekly-thread-2022-31 +author_username: realstevebauman +images: + - 'https://pbs.twimg.com/media/FY1jGv3XgAQba6L.jpg' +created_at: 2022-08-05T13:18:02+00:00 +slug: you-can-provide-closures-into-the-default-value-in-laravels-config-helper +--- +Huh, apparently you can provide closures into the $default value in Laravel's config helper. Neat! Pretty useful if you want to throw an exception if it's missing 👏 \ No newline at end of file diff --git a/content/tips/you-can-use-recursive-queries-to-query-hierarchical-trees.md b/content/tips/you-can-use-recursive-queries-to-query-hierarchical-trees.md new file mode 100644 index 0000000..69c8826 --- /dev/null +++ b/content/tips/you-can-use-recursive-queries-to-query-hierarchical-trees.md @@ -0,0 +1,13 @@ +--- +title: 'You can use recursive queries to query hierarchical trees' +tweet_id: '1555543666231369728' +thread_slug: weekly-thread-2022-31 +author_username: tobias_petry +images: + - 'https://pbs.twimg.com/media/FZOXjYuXwAA6ucp.jpg' +created_at: 2022-08-05T13:18:05+00:00 +slug: you-can-use-recursive-queries-to-query-hierarchical-trees +--- +⚡ Database Tip + +Recursive queries are a great solution to e.g. querying multiple levels in a tree with just one query. But you should use cycle detection otherwise your query might run forever or fail for loops in your data. https://sqlfordevs.io/cycle-detection-recursive-query \ No newline at end of file