Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Wilson committed Mar 26, 2015
1 parent e92bfcc commit 4884494
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ Install through Composer.
}
```

That's everything if you are using EloquentMeta and Eloquent **without** using Laravel. You will have to setup Eloquent as detailed
in its [documentation](https://github.com/illuminate/database).
That's everything if you are using EloquentMeta and Eloquent **without** using Laravel. You will have to setup Eloquent as detailed in its [documentation](https://github.com/illuminate/database).

If you **are using Laravel**, then you'll want to include the ServiceProvider that will register commands and the like. Update `config/app.php` to include a reference to this package's service provider in the providers array.

Expand All @@ -32,6 +31,22 @@ If you **are using Laravel**, then you'll want to include the ServiceProvider th

Finally, run the migration `php artisan vendor:publish` and `php artisan migrate` to create the database table.

If you **are not using Laravel** then you must create the table manually.

```sql
CREATE TABLE meta
(
id INTEGER PRIMARY KEY NOT NULL,
metable_id INTEGER NOT NULL,
metable_type TEXT NOT NULL,
key TEXT NOT NULL,
value TEXT NOT NULL
);
CREATE UNIQUE INDEX meta_key_index ON meta (key);
CREATE UNIQUE INDEX meta_metable_id_index ON meta (metable_id);

```

## Usage
Add the trait to all models that you want to attach meta data to:

Expand Down

0 comments on commit 4884494

Please sign in to comment.