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
eebf38f267
commit
622cb93b73
13 changed files with 135 additions and 1 deletions
|
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
title: 'Laravel provides a `Fluent` class as a universal structure for array data'
|
||||
tweet_id: '1489620180086902792'
|
||||
thread_slug: weekly-thread-2022-05
|
||||
author_username: cerbero90
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/FKcMWbwacAICnCw.png'
|
||||
created_at: 2022-02-04T15:21:41+00:00
|
||||
slug: laravel-provides-a-fluent-class-as-a-universal-structure-for-array-data
|
||||
---
|
||||
Fluent is a utility class provided by @laravelphp that lets us handle data fluently.
|
||||
|
||||
Out of the box it can be turned into an array or JSON, it can act as an array and it's serializable as a JSON.
|
||||
|
||||
It also gets and sets attributes dynamically and in a fluent way.
|
||||
|
||||
#Laravel #PHP
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
title: 'match() statements are a great way to clean up code'
|
||||
tweet_id: '1489620168233734144'
|
||||
thread_slug: weekly-thread-2022-05
|
||||
author_username: cerbero90
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/FKqzQ68aMAAqGdX.png'
|
||||
created_at: 2022-02-04T15:21:38+00:00
|
||||
slug: match-statements-are-a-great-way-to-clean-up-code
|
||||
---
|
||||
Match offers such a compact and clean syntax compared to its PHP alternatives 🌈
|
||||
|
||||
It can make our code way more readable and concise 💅
|
||||
|
||||
#PHP
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
title: 'You can add this Tailwind plugin to generate child-selector variants'
|
||||
tweet_id: '1489620177071210497'
|
||||
thread_slug: weekly-thread-2022-05
|
||||
author_username: warsh33p
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/FKaHaf9XsAQzC_0.jpg'
|
||||
created_at: 2022-02-04T15:21:40+00:00
|
||||
slug: you-can-add-this-tailwind-plugin-to-generate-child-selector-variants
|
||||
---
|
||||
🔥 Since I’m having to deal with a lot of generated markup recently, this small child-selector plugin for Tailwind has been a life saver.
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
title: 'You can disable lazy loading using Model::preventLazyLoading()'
|
||||
tweet_id: '1489620165201330177'
|
||||
thread_slug: weekly-thread-2022-05
|
||||
author_username: mattkingshott
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/FKlnRQ_XwAUqAxB.jpg'
|
||||
created_at: 2022-02-04T15:21:37+00:00
|
||||
slug: you-can-disable-lazy-loading-using-modelpreventlazyloading
|
||||
---
|
||||
🔥 #Laravel Tip: Protect your database from the dangers of lazy loading by disabling it in your Laravel app. You can also customise how violations are handled, which is perfect for models outside of your control e.g. within packages.
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
title: 'You can replace Laravel''s stubs to customize files generated using artisan commands'
|
||||
tweet_id: '1489620183085768706'
|
||||
thread_slug: weekly-thread-2022-05
|
||||
author_username: mattkingshott
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/FKbBGYpXIAACsW8.jpg'
|
||||
created_at: 2022-02-04T15:21:42+00:00
|
||||
slug: you-can-replace-laravels-stubs-to-customize-files-generated-using-artisan-commands
|
||||
---
|
||||
🔥 #Laravel Tip: If you find yourself constantly making changes to new files generated by Artisan's 'make' commands, then consider publishing the stubs and creating your own defaults. It can be a real time saver:
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
title: 'You can swap multiple keywords in a string using this macro'
|
||||
tweet_id: '1489620174093176833'
|
||||
thread_slug: weekly-thread-2022-05
|
||||
author_username: aarondfrancis
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/FKd_FZRXsAEgBjK.jpg'
|
||||
created_at: 2022-02-04T15:21:39+00:00
|
||||
slug: you-can-swap-multiple-keywords-in-a-string-using-this-macro
|
||||
---
|
||||
This is one of those macros I carry around from project to project.
|
||||
|
||||
Super clear, super easy, nice little life improvement.
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
title: 'You can track logins and logouts for auditing purposes using Laravel''s native auth events'
|
||||
tweet_id: '1489620171241050112'
|
||||
thread_slug: weekly-thread-2022-05
|
||||
author_username: mattkingshott
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/FKlsjn1WQAU_Xg2.jpg'
|
||||
created_at: 2022-02-04T15:21:39+00:00
|
||||
slug: you-can-track-logins-and-logouts-for-auditing-purposes-using-laravels-native-auth-events
|
||||
---
|
||||
🔥 #Laravel Tip: Tracking logins and logouts for auditing or security purposes is incredibly easy thanks to Laravel’s login and logout events. Simply listen for them in a service provider and respond when they are fired.
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
title: 'You can use the getCollection() and setCollection() methods on the paginator to interact with the underlying data'
|
||||
tweet_id: '1489620186109857800'
|
||||
thread_slug: weekly-thread-2022-05
|
||||
author_username: alanrezende
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/FKngV3LWQAQcft4.png'
|
||||
created_at: 2022-02-04T15:21:42+00:00
|
||||
slug: you-can-use-the-getcollection-and-setcollection-methods-on-the-paginator-to-interact-with-the-underlying-data
|
||||
---
|
||||
🔥 #Laravel paginator tip: you can use getCollection and setCollection if you need to do something to the paginator underlying data. Trust me you'll know when you need this.
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
title: 'You can use the new Str::transliterate() helper to convert a string to its closest ASCII representation'
|
||||
tweet_id: '1489620162357579778'
|
||||
thread_slug: weekly-thread-2022-05
|
||||
author_username: freekmurze
|
||||
images:
|
||||
- 'https://pbs.twimg.com/media/FKmRs46XsAA85Bh.jpg'
|
||||
created_at: 2022-02-04T15:21:37+00:00
|
||||
slug: you-can-use-the-new-strtransliterate-helper-to-convert-a-string-to-its-closest-ascii-representation
|
||||
---
|
||||
Pretty cool string helper method
|
||||
https://laravel-news.com/laravel-8-82-0
|
||||
#laravel #php
|
||||
Loading…
Add table
Add a link
Reference in a new issue