user3266023
user3266023

Reputation: 123

response and redirect on one return on laravel 4

I want return response that can download and a redirect that can redirect to other page on the same controller function is it possible if so how can I do it if you could show me like this code if i want to download and then redirect to other page. on one controller.

public function handledown()
{
    return Response::download(Input::get('book')) & Redirect::action('ViewController@book');
}

Upvotes: 0

Views: 2904

Answers (1)

Matt Burrow
Matt Burrow

Reputation: 11057

You can't return multiple responses like you are trying to do there.

My advice to you would be to return the response download and then redirect to a route you define within a data-redirect attribute on your button etc what ever you use, with jQuery etc.

Another solution can be found here.

Upvotes: 1

Related Questions