Support the ongoing development of Laravel.io →
posted 10 years ago
Requests
Last updated 1 year ago.
0

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

Last updated 1 year ago.
0

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 ;)

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

heidilux heidilux Joined 3 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.