bosnadev / repository

Laravel Repositories is a package for Laravel 5 which is used to abstract the database layer. This makes applications much easier to maintain.
https://bosnadev.com
825 stars 235 forks source link

update() method does not work. #50

Open DesmondPang opened 9 years ago

DesmondPang commented 9 years ago

The updata() method does not work. It seems that you missed the first() after where() The where() return an array but not an unique model.

public function update(array $data, $id, $attribute="id") { return $this->model->where($attribute, '=', $id)->update($data); }

DesmondPang commented 9 years ago

Actually, they update() is not called. where($attribute, '=', $id) returns a array and it cannot pass to update().