Skip to content

Commit

Permalink
update eloquent docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 25, 2013
1 parent cd5344c commit cad0ffa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion eloquent.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,18 @@ To get started, create an Eloquent model. Models typically live in the `app/mode

**Defining An Eloquent Model**

class User extends Eloquent {}

Note that we did not tell Eloquent which table to use for our `User` model. The lower-case, plural name of the class will be used as the table name unless another name is explicitly specified. So, in this case, Eloquent will assume the `User` model stores records in the `users` table. You may specify a custom table by defining a `table` property on your model:

class User extends Eloquent {

protected $table = 'users';
protected $table = 'my_users';

}

> **Note:** Eloquent will also assume that each table has a primary key column named `id`. You may define a `primaryKey` property to override this convention:
Once a model is defined, you are ready to start retrieving and creating records in your table. Note that you will need to place `updated_at` and `created_at` columns on your table by default. If you do not wish to have these columns automatically maintained, set the `$timestamps` property on your model to `false`.

**Retrieving All Models**
Expand Down

0 comments on commit cad0ffa

Please sign in to comment.