When working on Laravel projects, you must constantly monitor your server’s storage usage. Large folders can quickly become a problem until your server starts running low on space. To keep things in check, here’s a small helper that’s specifically designed to help you do just that! 🤖
- Calculates the size of each folder inside
storage/
. - Displays both raw size (bytes) and a human-readable format (KB / MB / GB). 😬
- Allows sorting results in ascending or descending order. 👍
This essential tool can be incredibly handy when monitoring a live server, allowing you to quickly identify which folders are consuming the most space. 🚀
Full code: View the code on Gist
⚡ This is a lightweight utility, but it can save you time and help keep your servers clean.
Note:
- The code works starting from Laravel 10+.
- This is just a small idea, and of course, it’s open for customization or further development.
🙏 If you found this useful, share it with your network it might save someone else hours of debugging or running out of server space.