try this
public function saveOrder(User $user)
{
$newOrder = $this->saveNewOrder($order);
$cust = Stripe_Customer::retrieve($user->billing_id);
return Redirect::route( 'success' )
->with( 'user', $user )
->with( 'newOrder', $newOrder )
->with( 'cust', $cust );
}
public function showSuccess()
{
$user = Session:get( 'user' );
$order = Order::find( Session::get( 'newOrder' ) );
$cust = Session::get( 'cust' );
return View::make('shop.success', compact('order', 'user', 'cust'));
}
The only place where you can pass an array that it will explodes into single variables is on View::make
, Redirect::to
, Redirect::action
and Redirect::route
, etc, you must use the with
function, those values will be available in the Session
singleton
Also you can also use the with
function on View::make
Still I don't think this solution gonna work for you, because you are storing an object with Session
, you gonna to think a workaround for this problem
Thanks arcollector. You're right of course. That does work. I was hoping for a different solution, but that may be the most elegant available to me. I'm not sure why I was hoping for a different solution though ;)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community