diff --git a/docs/developers/addons.md b/docs/developers/addons.md index 9d2ea0fd..04533a44 100644 --- a/docs/developers/addons.md +++ b/docs/developers/addons.md @@ -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 @@ -197,6 +205,8 @@ if(Auth::check()) # Database Access + + ## Models Models are the more basic way to access your database tables. For example, if @@ -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