2017 © Pedro Peláez
 

library eloquent-ember

image

rtablada/eloquent-ember

  • Thursday, June 5, 2014
  • by rtablada
  • Repository
  • 4 Watchers
  • 36 Stars
  • 123 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 6 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

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

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., (*2)

Installation

Just add rtablada/eloquent-ember to your composer.json., (*3)

Use

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

Now instead of calling toArray() call toEmberArray()., (*5)

Heres an example controller for referece, (*6)

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();
}

The Versions

05/06 2014

dev-master

9999999-dev

  Sources   Download

MIT

The Requires