Beyond SOLID principles & patterns
Here you'll find OctoberCMS best practices which tend to be overlooked in real life October projects.
OctoberCMS does not follow traditional Laravel naming conventions for a number of reasons. As such, you should utilize the naming conventions accepted by the OctoberCMS community:
Follow naming conventions accepted by the OctoberCMS community:
What | How | Good | Bad |
---|---|---|---|
Controller | plural | Articles | |
Model | singular | User | |
hasOne or belongsTo relationship | singular | articleComment | |
All other relationships | plural | articleComments | |
Table name | author_plugin_ prefix, plural | acme_blog_article_comments | |
Pivot table | author_plugin_ prefix, semantically correct | acme_blog_user_articles | |
Boolean columns | is_prefix | is_active | |
Migration | version folder heirarchy | 1.0.1/create_articles_table | |
Method | camelCase | getAll | |
Controller method (regular) | match partial name | index | |
Controller method (AJAX handler, specific method) | method prefix, camelCase | index_onDoSomething | |
Controller method (AJAX global handler) | on prefix, TitleCase | onAjaxRequest | |
Controller YAML | snake_case | config_form.yaml | |
Model YAML | columns/fields prefix, snake_case | columns_simple.yaml | |
Controller partials | _prefix, snake_case, .htm extension | _users.htm | |
Class references | qualified namespace | \Backend\Behaviors\FormController::class | |
Vendor naming | TitleCase | AcmeCo.SuperPlugin |
Also Follow Laravel naming conventions & PSR standards when possible.
OctoberCMS is built on Laravel.
The best place to learn about OctoberCMS is by reading the documentation or following some tutorials.
Please follow the following guides and code standards: