123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace App\Http\Controllers;
- use App\Http\Requests\RegistrationForm;
- use App\Mail\Welcome;
- use Illuminate\Session\SessionManager;
- use Illuminate\Session\Store;
- class RegistrationController extends Controller
- {
- public function create()
- {
- return view('registration.create');
- }
- /**
- * Submitted data validation:
- * - now in RegistrationRequest::rules().
- * - the code in this method won't be run if validation fails.
- * - validation is found by Reflection on the method type hint.
- */
- public function store(RegistrationForm $request)
- {
- $user = $request->persist();
- // Sign user in.
- auth()->login($user);
- \Mail::to($user)->send(new Welcome($user));
- $session = session();
- $session->flash('message', 'Thanks so much for signing up.');
- return redirect()->home();
- }
- }
|