Laravel not redirecting to route -
I am trying to validate some data from a data and redirects the user to the page with any errors I am My code does not redirect to any route. The path of all my passages works well I have echoed the input with input (all) and it has user input in it The verifier works also I am not sure What is actually prohibiting the redirect: Working from the path
Public function postPurchase () {$ validator = validator :: make (input :: all (), array ('condition' & Gt; 'Required', 'Memory' = & gt; 'Required', 'Color' = & gt; 'Required', 'luggage' = & gt; 'required', 'shipping' = & gt; 'required')); // $ input = input :: all (); // DD ($ input); If ($ validator-> fails ()) // // resonant "string"; Return Redirect :: Way ('Home'); } Other {resonant "this succedded"; } // Get prices, item IDs, and send to the user on the checkout page / "Get value, item ID, etc. and send the user to checkout page"; } This is the code that precedes the post purchase method:
public function getPurchase () {return view :: create ('general. Purchase '); } Public Function getCheckout () {Return View :: Create ('general.checkout'); } Public event postPurchaseCheck () {$ input = input :: all (); $ This- & gt; Input = $ input; If (Input :: Receive ('Buy')) {$ this-> PostPurchase (); } Elseif (Input :: find ('cart')) {$ this-> PostAddCart (); }}
You call functions - but you do not 'return' which is redirect
Change
if (get input: (buy '')) {$ this-> PostPurchase (); } to if (input :: find ('buy')) {return $ this- & gt; PostPurchase (); }
Comments
Post a Comment