diff --git a/content/threads/weekly-thread-2022-26.md b/content/threads/weekly-thread-2022-26.md new file mode 100644 index 0000000..f2e5519 --- /dev/null +++ b/content/threads/weekly-thread-2022-26.md @@ -0,0 +1,11 @@ +--- +slug: weekly-thread-2022-26 +title: 'Weekly thread #26 of 2022' +tweet_id: '1542863724968480769' +author_username: archtechx +created_at: 2022-07-01T13:32:31+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/encrypted-casts-can-use-unique-model-derived-keys.md b/content/tips/encrypted-casts-can-use-unique-model-derived-keys.md new file mode 100644 index 0000000..37ecf9f --- /dev/null +++ b/content/tips/encrypted-casts-can-use-unique-model-derived-keys.md @@ -0,0 +1,13 @@ +--- +title: 'Encrypted casts can use unique model-derived keys' +tweet_id: '1542863733004767234' +thread_slug: weekly-thread-2022-26 +author_username: mattkingshott +images: + - 'https://pbs.twimg.com/media/FWazRABX0AAps0t.jpg' +created_at: 2022-07-01T13:32:33+00:00 +slug: encrypted-casts-can-use-unique-model-derived-keys +--- +๐Ÿ”ฅ #Laravel Tip: + +The default encryption cast for Eloquent models uses the app key, making rotation difficult and allowing anyone with key to decrypt all the DB. To address this, consider creating a custom cast that uses the model to create its own unique key. \ No newline at end of file diff --git a/content/tips/laravels-ratelimiter-can-be-used-to-throttle-any-parts-of-your-code.md b/content/tips/laravels-ratelimiter-can-be-used-to-throttle-any-parts-of-your-code.md new file mode 100644 index 0000000..997cf4a --- /dev/null +++ b/content/tips/laravels-ratelimiter-can-be-used-to-throttle-any-parts-of-your-code.md @@ -0,0 +1,11 @@ +--- +title: 'Laravel''s RateLimiter can be used to throttle ANY parts of your code' +tweet_id: '1542863730194538496' +thread_slug: weekly-thread-2022-26 +author_username: mattkingshott +images: + - 'https://pbs.twimg.com/media/FWflzWuWYAAyvkB.jpg' +created_at: 2022-07-01T13:32:32+00:00 +slug: laravels-ratelimiter-can-be-used-to-throttle-any-parts-of-your-code +--- +๐Ÿ”ฅ #Laravel Tip: Rate-limiting is not only for throttling entire requests. You can also use it to throttle methods or parts of your code, which can be really useful when you need to protect things against spikes e.g. the DB. \ No newline at end of file diff --git a/content/tips/use-database-partitions-to-delete-large-chunks-of-data-efficiently.md b/content/tips/use-database-partitions-to-delete-large-chunks-of-data-efficiently.md new file mode 100644 index 0000000..f22fac3 --- /dev/null +++ b/content/tips/use-database-partitions-to-delete-large-chunks-of-data-efficiently.md @@ -0,0 +1,13 @@ +--- +title: 'Use database partitions to delete large chunks of data efficiently' +tweet_id: '1542863735810797569' +thread_slug: weekly-thread-2022-26 +author_username: tobias_petry +images: + - 'https://pbs.twimg.com/media/FWacS3jWAAAHLyu.jpg' +created_at: 2022-07-01T13:32:34+00:00 +slug: use-database-partitions-to-delete-large-chunks-of-data-efficiently +--- +โšก Database Tip + +Some applications want to periodically delete old historic data (or have to because of regulations). Deleting billions of rows is a very slow task that could take several minutes and may take your application down. Use partitions for efficient deleting! \ No newline at end of file diff --git a/content/tips/you-can-eager-load-nested-relations-using-clean-array-syntax.md b/content/tips/you-can-eager-load-nested-relations-using-clean-array-syntax.md new file mode 100644 index 0000000..3040409 --- /dev/null +++ b/content/tips/you-can-eager-load-nested-relations-using-clean-array-syntax.md @@ -0,0 +1,11 @@ +--- +title: 'You can eager load nested relations using clean array syntax' +tweet_id: '1542863727476690944' +thread_slug: weekly-thread-2022-26 +author_username: ecrmnn +images: + - 'https://pbs.twimg.com/media/FWRcqFbUsAE7MW7.jpg' +created_at: 2022-07-01T13:32:32+00:00 +slug: you-can-eager-load-nested-relations-using-clean-array-syntax +--- +Yay! In Laravel 9.18 you can finally eager load ("with") using a nested array. \ No newline at end of file