Hola
Hola

Reputation: 2233

how to pass data from one application to another in Laravel?

I want to pass data from one application to another in Laravel..

Suppose I want to take user data from one application and I want to send this data to another application form.

I wanted to send it this way..But I'm getting Error.. So if anyone could suggest any solution for this..would be appreciated ..

public function store(Request $request)
    {
        $payment = new Payment();
        $payment->username = $request->Input(['username']);
        $payment->price = $request->Input(['price']);
        $payment->purchase_id = $request->Input(['purchase_id']);
        $payment->save();
        $store_id =\Hash::make($payment->id);
        $price = $payment->price; 

        return \Redirect::to('http://localhost/blog/public/getPayment');
    }

And I get the following Error:

InvalidArgumentException in Response.php line 462:
The HTTP status code "0" is not valid.

Upvotes: 1

Views: 1362

Answers (1)

Elie Faës
Elie Faës

Reputation: 3315

If you just want your user to be redirected to another app so they can fill whatever forms you can use

return Redirect::away('http://localhost/blog/public/getPayment');

See the method here.

BUT

If you want to send data to another app without redirecting the user, the best solution I can give is to make an API on this other app so you can make requests (with Guzzle or something else) to this API, allowing you to pass some data.

Upvotes: 2

Related Questions