Laravel - Database, Table and Column Naming Conventions?

前端 未结 4 1348
生来不讨喜
生来不讨喜 2020-12-03 05:14

I\'m using laravel eloquent data objects to access my data, what is the best way to name my tables, columns, foreign/primary keys etc?

I found, there are lots of nam

4条回答
  •  甜味超标
    2020-12-03 05:33

    The default table naming conventions can easily cause conflicts with the installation of multiple packages who may have incidentally the same class names. A solution would be to name tables as: [vendor].[package].[class], which is in line with how namespacing in Laravel is applied.

    Edited: Using dots in table names is not recommended though. Would there be an alternative convention to use to ensure developers of a modular built application do not need to worry about existing table names.

提交回复
热议问题