Skip to content

Commit

Permalink
account updated fires on patch
Browse files Browse the repository at this point in the history
  • Loading branch information
MelonSmasher committed Nov 17, 2017
1 parent 76b7fba commit 123757d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/Http/Controllers/API/V1/AccountController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Controllers\API\V1;

use App\Events\Api\Account\AccountUpdated;
use App\Events\Api\Account\AssignedCourse;
use App\Events\Api\Account\AssignedDepartment;
use App\Events\Api\Account\AssignedDuty;
Expand Down Expand Up @@ -348,6 +349,8 @@ public function patch(Request $request)
$trans = new AccountTransformer();
// Update the account
$item->update($data);
// Fire the update event
event(new AccountUpdated($item));
// Get the updated account
$item = $trans->transform($item->firstOrFail());
// Return a response
Expand Down

0 comments on commit 123757d

Please sign in to comment.