0

Is there any way to change the table name of the models, or specify a table prefix, so that the model named People, for example, would reference the table TP_PEOPLE?

1 Answers1

0

There is a way, you can use the @Table annotation, such as:

@Table("TP_PEOPLE")
public class People extends Model {}

however, I would suggest to call your class Person, since the instance of this class represent a single row from your table:

@Table("TP_PEOPLE")
public class Person extends Model {}

so that your code will look:

List<Person> people = Person.where("ssn  = ?", ssn);
ipolevoy
  • 5,432
  • 2
  • 31
  • 46