|
@@ -9,6 +9,8 @@ use Illuminate\Foundation\Auth\RegistersUsers;
|
|
use Illuminate\Support\Facades\Hash;
|
|
use Illuminate\Support\Facades\Hash;
|
|
use Illuminate\Support\Facades\Validator;
|
|
use Illuminate\Support\Facades\Validator;
|
|
|
|
|
|
|
|
+use App\Events\SendTweet;
|
|
|
|
+
|
|
class RegisterController extends Controller
|
|
class RegisterController extends Controller
|
|
{
|
|
{
|
|
/*
|
|
/*
|
|
@@ -64,10 +66,16 @@ class RegisterController extends Controller
|
|
*/
|
|
*/
|
|
protected function create(array $data)
|
|
protected function create(array $data)
|
|
{
|
|
{
|
|
- return User::create([
|
|
|
|
|
|
+
|
|
|
|
+ $user = User::create([
|
|
'name' => $data['name'],
|
|
'name' => $data['name'],
|
|
'email' => $data['email'],
|
|
'email' => $data['email'],
|
|
'password' => Hash::make($data['password']),
|
|
'password' => Hash::make($data['password']),
|
|
]);
|
|
]);
|
|
|
|
+
|
|
|
|
+ event(new SendTweet($user));
|
|
|
|
+
|
|
|
|
+ return $user;
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|