Skip to content

Commit

Permalink
trying find for fail based on id for account
Browse files Browse the repository at this point in the history
  • Loading branch information
MelonSmasher committed Nov 21, 2017
1 parent 8ab1892 commit 7e14c48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/Http/Controllers/API/V1/AccountController.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,11 @@ public function patch(Request $request)
$trans = new AccountTransformer();
// Update the account
$item->update($data);
$item = $item->firstOrFail();
// Fire the update event
$account = Account::where('identifier', $data['identifier'])->firstOrFail();
event(new AccountUpdated($account));
event(new AccountUpdated($item));
// Get the updated account
$item = $trans->transform($item->firstOrFail());
$item = $trans->transform($item);
// Return a response
return $this->response->created(route('api.accounts.show', ['id' => $item['id']]), ['data' => $item]);
}
Expand Down

0 comments on commit 7e14c48

Please sign in to comment.