Support the ongoing development of Laravel.io →
Forms Views Laravel
Last updated 2 years ago.
0

I really did not see any of your code, but as I understood: try to flash the data from one view to the other with get as:

/* array $data with the keys and values after the first validation */
flash($data)
redirect('/somewhere');

I hope this give you a idea

0

Am getting this error Call to undefined function App\Http\Controllers\flash()

0

Session::flash($data)

I am sorry I forgot about the facade method

Now should work, and be aware that this value only lives for one request,

And I don't exact what you are doing, but look at old() laravel documentation. You might inside your input to preserve the value after a validation fail,

<input type="text" value="{{old($form->value)}}" for="field_name">
0

@Lucas Oliveira

Thank you for your support. I believe you misunderstood me.

Here is my route.

Route::get('add-job', ['as' => 'add.job', 'uses' => 'HomeController@addJob');
Route::post('add-job', ['as' => 'store.job', 'uses' => 'HomeController@storeJob');

And inside my ``` HomeController@storeJob


I want to return a view after the form is validated thus when no data errors and data saved into database.

But after my validation check. I did 

return view('user.manage-job');


This works. but when you press F5 on the keyboard or refresh button is press them form submits again. 

To solve this issue i have to use ```
redirect() method.

I don't want to use ``` redirect->route('user.manage.route');


I want the url to maintain as > add.job

I hope you understand now
0

Hey thanks for sharing information

0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.