diff --git a/README.md b/README.md index 445dc76..a5834ef 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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: