Recent posts with #CleanCode

image
๐—ง๐—ถ๐—ฝ ๐—ผ๐—ณ ๐—ง๐—ต๐—ฒ ๐——๐—ฎ๐˜† ๐—ณ๐—ผ๐—ฟ ๐—Ÿ๐—ฎ๐—ฟ๐—ฎ๐˜ƒ๐—ฒ๐—น๐—ถ๐—ฎ๐—ป๐˜€โค๏ธ

Struggling with "Permission denied" errors on AlmaLinux? ๐Ÿค”

Don't worry! This common server issue has an elegant solution that maintains security while allowing your Laravel app to run smoothly. Let's fix it properly! ๐Ÿš€๐Ÿ’ช

๐Ÿ. ๐–๐ก๐š๐ญ ๐ข๐ฌ ๐‡๐š๐ฉ๐ฉ๐ž๐ง๐ข๐ง๐ ?
๐˜€๐—ฒ๐˜๐—ฒ๐—ป๐—ณ๐—ผ๐—ฟ๐—ฐ๐—ฒ: Turn off selinux access control security standard

๐—ฐ๐—ต๐—ฐ๐—ผ๐—ป: Changes file security context for web server access

๐—ต๐˜๐˜๐—ฝ๐—ฑ_๐˜€๐˜†๐˜€_๐—ฟ๐˜„_๐—ฐ๐—ผ๐—ป๐˜๐—ฒ๐—ป๐˜_๐˜: Allows Apache/Nginx read-write access

๐Ÿ. ๐”๐ฌ๐ž ๐‚๐š๐ฌ๐ž
When deploying Laravel to AlmaLinux/CentOS/RHEL and facing:

1. Storage directory write issues.

2. Cache and Session storage failures.

3. Bootstrap directory write issues.

This SELinux context solution resolves permission errors without compromising security!

#CodeTips
#Laravelians
#Laravel
#CleanCode
#WebDevelopment
#PHP

โ€ข โ€ข

56

โ€ข
โ€ข

Clean Up Your Code in Vibe Coding!

As developers, we all know how unnecessary comments can clutter our code, reduce readability, and slow down collaboration.

I just published a guide on how to remove auto-generated comments in Vibe Coding, specifically for .tsx and .php files, and how you can integrate this cleanup into your workflow for a cleaner, more professional codebase.

Whether youโ€™re a beginner or an experienced developer, automating this process will save you time and keep your projects organized.

Read the full guide here: msamgan.com/clean-up-your-code-remove-auto-generated-comments-by-vide-coding-laravel



Pro tip: You can even add this command to your pre-commit hooks or formatting workflow for consistent, automated cleanup.

#VibeCoding #CleanCode #DeveloperTips #Programming #WebDevelopment #CodeQuality #Laravel #FrontendDevelopment #PHP #CodingBestPractices

โ€ข โ€ข

37

โ€ข
โ€ข

image
๐—ง๐—ถ๐—ฝ ๐—ผ๐—ณ ๐—ง๐—ต๐—ฒ ๐——๐—ฎ๐˜† ๐—ณ๐—ผ๐—ฟ ๐—Ÿ๐—ฎ๐—ฟ๐—ฎ๐˜ƒ๐—ฒ๐—น๐—ถ๐—ฎ๐—ป๐˜€โค๏ธ

Laravel is amazing when it comes to simplifying data filtering and collection manipulation. Let's dive into an incredibly handy feature Laravel provides with collection methods! ๐Ÿš€๐Ÿ’ช

๐Ÿ. ๐–๐ก๐š๐ญ ๐ข๐ฌ ๐‡๐š๐ฉ๐ฉ๐ž๐ง๐ข๐ง๐ ?
๐—ฟ๐—ฒ๐—ท๐—ฒ๐—ฐ๐˜(): Quickly excludes all items that match certain conditions.

๐Ÿ. ๐”๐ฌ๐ž ๐‚๐š๐ฌ๐ž
Imagine you want to manage a user list displaying only active members in your application dashboard. Using collection methods like ๐—ฟ๐—ฒ๐—ท๐—ฒ๐—ฐ๐˜(), you can easily clean up your data without cluttering your codebase with loops or complex conditions.

Clean code, clearer logic!

#CodeTips
#Laravelians
#Laravel
#CleanCode
#WebDevelopment
#PHP
#BestPractices

3 โ€ข โ€ข

159

โ€ข
โ€ข

image
๐—ง๐—ถ๐—ฝ ๐—ผ๐—ณ ๐—ง๐—ต๐—ฒ ๐——๐—ฎ๐˜† ๐—ณ๐—ผ๐—ฟ ๐—Ÿ๐—ฎ๐—ฟ๐—ฎ๐˜ƒ๐—ฒ๐—น๐—ถ๐—ฎ๐—ป๐˜€โค๏ธ

No need to recall the same controller class again & again! ๐Ÿคฏ
Today, let's explore how the controller() route helper can make your code cleaner and more maintainable. Route grouping just got more beautiful! ๐Ÿš€๐Ÿ’ช

๐Ÿ. ๐–๐ก๐š๐ญ ๐ข๐ฌ ๐‡๐š๐ฉ๐ฉ๐ž๐ง๐ข๐ง๐ ?
๐—ฐ๐—ผ๐—ป๐˜๐—ฟ๐—ผ๐—น๐—น๐—ฒ๐—ฟ(): Groups multiple routes under a single controller class.

๐—ด๐—ฟ๐—ผ๐˜‚๐—ฝ(): Keeps related routes organized together.

๐Ÿ. ๐”๐ฌ๐ž ๐‚๐š๐ฌ๐ž
Suppose you are building an API or web application with multiple actions in one controller. You don't want to cumbersome your routes files & want to make it clean & maintainable.
This approach will be your goto choice, it reduces duplication and improves readability!

#Laravelians
#Laravel
#CleanCode
#WebDevelopment
#PHP
#BestPractices

โ€ข โ€ข

71

โ€ข
โ€ข

โ€œWriting tests slows us down.โ€

This is a common argument โ€” and in the short term, it can feel true.

But over time, teams that donโ€™t write tests move slower:
โ€ข More regressions
โ€ข More hotfixes
โ€ข More blame

Tests arenโ€™t just about catching bugs โ€” theyโ€™re about building trust, clarity, and stability.

Testing is how you invest in sustainable delivery.

#SoftwareEngineering #CleanCode #TeamCulture #Testing #DevEx

โ€ข โ€ข

87

โ€ข
โ€ข