php - What is the correct way of configing Eloquent globally? -


eloquent has assumptions regarding db tables.

  • it uses plural name of class tables name. use singular nouns tables' name.
  • by default, eloquent expects created_at , updated_at columns. use cdata , udate
  • i use camelcase name columns not underline_separated names.

i know possible use class properties overwrite those. correct way config globally?

instead of extending model class create new class example mymodel , setup attributes there. extend mymodel


Comments