Skip to content

Instantly share code, notes, and snippets.

@Naoray
Created November 30, 2017 19:48
Show Gist options
  • Save Naoray/1aa5cfdddfdcfa3261f07adae4106be1 to your computer and use it in GitHub Desktop.
Save Naoray/1aa5cfdddfdcfa3261f07adae4106be1 to your computer and use it in GitHub Desktop.
<?php
class SparkServiceProvider
{
public function booted()
{
Spark::swap('UpdateContactInformatio@handle', function ($user, array $data) {
$user->forceFill([
'name' => $data['name'],
'email' => $data['email'],
'phone' => $data['phone']
])->save();
event(new ContactInformationUpdated($user));
return $user;
});
//...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment