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
823 stars 233 forks source link

Updates do not trigger Eloquent Events #61

Open jwood-intouch opened 8 years ago

jwood-intouch commented 8 years ago

Using the update call in this repository does not trigger an updated Eloquent event.

Current code for said function

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

To fix it, should be something like this:

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