Skip to content

Add Module and Table Naming Conventions for 3rd parties #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/developers/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ see the source for the module,

:::

:::tip

When naming your module, it is recommended that if your module name runs the risk of being generic, to prefix your module name with a unique identifier. For example, instead of naming your module `Tours`, name it `XXTours` (The XX in the example being the identifier or brand name you choose)

In doing this, you reduce the chance of your module name conflicting directly with another module.

:::

---

## Namespacing
Expand Down Expand Up @@ -197,6 +205,8 @@ if(Auth::check())

# Database Access



## Models

Models are the more basic way to access your database tables. For example, if
Expand Down Expand Up @@ -300,6 +310,17 @@ it's seen that it's already run the file, it won't run it again.

:::

:::warning[Table Name Convention]

When naming tables, table names *should* be prefixed with a short indentifier that is unqiue to your addon or group of addons (e.g. `disposable_`, `ch_`, `sp_`, etc.). For example, instead of naming a table `tours`, name it `ch_tours`. This includes pivot tables. See Laravel documentation on how to override the default conventions for table names, foreign relationships, etc. where required.

Not prefixing your tables could lead to unintended consequences, including but not limited to:

* Conflicting with future phpVMS core features that would use the same table name, thereby making it more difficult to update phpVMS at a later date.
* Conflicting with other addons by other 3rd party modules that don't head this warning.

:::

### Seeding Data

I've added a few extra features, including adding seed data, including adding
Expand Down
Loading