/** * @param SignupRequest $request * @param Guard $guard * @return \Illuminate\Http\RedirectResponse */ public function store(SignupRequest $request, Guard $guard) { $data = $request->only(['email', 'password']); $invitation = null; if ($request->has('invitation')) { $invitation = MembershipInvitation::find($request->get('invitation')); if (!$invitation) { return redirect()->back()->with('message', 'failed'); } } if ($user = $this->dispatch(new Signup($request->get('email'), $request->get('password'), $invitation))) { if ($user->confirmed) { //user can be logged in too $guard->login($user); return redirect()->to(store_route('store.dash')); } return redirect()->to(store_route('store.home'))->with('message', 'success'); } return redirect()->back()->with('message', 'failed'); }
/** * @param Theme $theme * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function test(Theme $theme) { return view('account::admin.members.invitation.email', ['theme' => $theme, 'theme_template' => config('theme.email_template'), 'invitation' => MembershipInvitation::first()]); }
/** * @param MembershipInvitation $invitation * @return mixed */ public function index(MembershipInvitation $invitation) { return MembershipInvitation::orderBy('created_at', 'asc')->get(); }