New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

rtablada/eloquent-ember

128 32
Install
composer require rtablada/eloquent-ember:dev-master
PHP:>=5.3.0
License:MIT
Last Updated:Jun 5, 2014
Links: GitHub  ·  Packagist
Maintainer: rtablada

This has been deprecated. For the reasoning behind this checkout http://ryantablada.com/post/why-i-am-deprecating-eloquent-ember.

This package is set to work with Ember Data before 1.0 Beta. This may function with the new ActiveModelAdapter but is no longer tested or in active development.

Installation

Just add rtablada/eloquent-ember to your composer.json.

Use

In your models just extend Rtablada\EloquentEmber\Model. Also, list all of your relationships in the withIds property on your model.

Now instead of calling toArray() call toEmberArray().

Heres an example controller for referece

public function index()
{
	return $this->orderModel->all()->toEmberArray();
}

public function store()
{
	$input = Input::json();

	$order = $this->orderModel->create($input->get('order'));
	$order = $order->toArray();

	return Response::json(compact('order'));
}

public function show($id)
{
	$order = $this->orderModel->findOrFail($id);

	return $order->toEmberArray();
}

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

651,963,193 9,701
laravel/framework

The Laravel Framework.

604,216,237 34,982
laravel/tinker

Powerful REPL for the Laravel framework.

518,004,183 7,444
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

435,097,283 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

407,699,310 4,663