#redirect a user with their model and then redirect again

1 messages · Page 1 of 1 (latest)

astral quail
#

Lets start off with the code

if($request->berbix == true || $request->berbix == 'true'){
          THIS IS WHERE I NEED THE LOGIC TO GO  
        }
        else {
        session()->flash('flash.banner', 'Profile updated!');
        session()->flash('flash.bannerStyle', 'success');
        return Redirect::route('dashboard');
        }

In the if statement this is what needs to happen.

  • user needs to be send to /verification/create with their user model
  • When that is completed, it will provide a URL
  • user then needs to be redirected to said URL

I know this should be simple but I am having a HECK of a time wrapping my head around the simple logic. The main thing I am struggling with (and I know why, but don't know how to solve it), is when I do for example Http::get() it isnt sending it as the user so the request doesn't know the user info

Any help either a solution or a nudge on what I need to do would be very nice right now!

spice lintel
astral quail
#

So, I was able to get it working based on a number of things (mainly getting some sleep) but this is the new issue

if($request->berbix == true || $request->berbix == 'true'){
            $url = app()->call('App\Http\Controllers\BerbixController@createVerification', [
                'user' => auth()->user()
            ]);
            return redirect($url['hostedUrl']);
        }

On the redirect because it is an external link I am getting CORS on the frontend. I hate CORS and I am not sure how to resolve it now.