The 10 Commandments of Laravel

Written on the artisan tablets

I.

Thou Shalt Sanctify Routes

Thou shalt not place business logic in thy route files, for this is a grave sin in the eyes of the Framework. Keep thy routes organized and clear, using controllers for all complex logic.

II.

Honor Thy Models and Migrations

Thou shalt always create migrations to modify thy database, never altering it directly. And in thy models, thou shalt define clear relationships and use Eloquent as thy single source of truth.

III.

Thou Shalt Not Commit SQL Injection

Thou shalt always use Eloquent queries or Query Builder, for they shall protect thee against the temptations of SQL injection. Thou shalt not concatenate strings in thy queries, for this is the path to perdition.

IV.

Guard Thy Requests

Thou shalt validate all inputs using Form Requests, for impure data must not enter thy application. Keep thy validation rules organized and reusable.

V.

Thou Shalt Not Reuse Passwords in Production

Thou shalt properly configure thy .env file in production, for using the same credentials as thy local environment is an abomination. Guard thy secrets with zeal.

VI.

Neglect Not Thy Queues

Thou shalt process heavy tasks in jobs and queues, for making thy user wait is a sin. Configure thy workers properly and monitor thy queues.

VII.

Honor Thy Cache

Thou shalt use cache wisely, for the performance of thy application is sacred. Invalidate thy cache when necessary and choose appropriate drivers.

VIII.

Thou Shalt Not Fail to Test

Thou shalt write tests for thy code, for deploying without tests is tempting fate. Feature tests and Unit tests shall be thy guides to a robust application.

IX.

Sanctify Thy Service Providers

Thou shalt register thy services and bindings correctly in Service Providers, for the container is sacred. Pollute not thy AppServiceProvider with code that does not belong.

X.

Keep Thy Laravel Updated

Thou shalt not leave thy application in old versions, for updates bring security and new blessings. Follow the upgrade guide with attention and devotion.

"For Artisan is thy guide, and Eloquent thy strength"
Created with ❤️ by Nilton Mendes