Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

266
Views
Laravel return page after submit with value

I have laravel crud store with $data for request input and $data2 to paste the input. I tried return redirect, return redirect back, return with with no avail. I tried with :

return view('myView', ["data" => $data2]);

My page "myView" have $data2 for result that I want. But everytime I reload the page it will submit another entry to database. Anyone here know what should I do? Prefent reload page or change return on submit method in my controller?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

After you submit value, then return response something like this:

return response()->json(['code'=>200, 'message'=>'Post Created successfully','data' => $data2], 200);

If you use ajax then the response is JSON.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!