1. Usage: Emberize::make($model or $collection)
2. Sideload,embed,links
2. (Not Yet)Polymorphic relationships.
3. Public keys(GUID, email, username, etc as id)
4. Change attributes,relationships dynamically(If authorized then include user relationship in json)
Installation
1. Add the following to your composer.json "require" array
"breadam/emberize": "dev-master"
2. Add the following to your app/config/app.php "providers" array
"Breadam\Emberize\EmberizeServiceProvider"
3. Update composer
composer update
4. Publish config file
php artisan config:publish breadam/emberize
5. Edit app/config/packages/breadam/emberize/config.php to your needs
Set default mode. If "null", Emberize will prepare only primary keys of relationships
value: null,sideload,embed,link
default: null
identifier:
If set, Emberize will use "key" as the primary key name and "value" attribute as primary key value. If not set, Emberize will use $model->getKeyName() and $model->getKey()
value:
"identifier" => array(
"key" => string,
"value" => string
)
default:
"identifier" => array(
"key" => $model->getKeyName(),
"value" => $model->getKey()
)
I'm new to emberjs, and looking forward to create an app with it and laravel.
If I'm not mistaken, this is supposed to be used with 'ember data" right ?
I'm also planning on using polymorphic relationships. But still can wrap my head around it with ember, does emberize support polymorphic relationships?
My models are in a dsl folder, and are all 'Entity' classes, which obviously causes issues.
To get around this i have used a var called modelName on my model and checked for it in the modelName function as a hack, but i am happy to make a more extensible system if you are interested.
I propose that the variable name be added to the config so people can customise it, and then add then add the check to model name.