My database query return random row from database. Is there any way when page load and return this random string when user refresh the page to not change the string?
So this is my controller
public function view() {
$view = View::orderByRaw("RAND()")->limit('1')->get();
return View::make('site.view', [
'view' => $view
]);
}
And in my blade I have
@foreach($view as $rand)
{{ Form::open() }}
{{ $rand['my_view'] }}
// bunch of form fealds
<button type="submit" class="btn btn-primary">Submit</button>
{{ Form::clode() }}
@endforeach
So here user got random string and need to fill the form and add also this string. Then I save all information in database. Everything is saved perfectly in database. The problem is that user can refresh multiple time table after he submit form and can get confused when he see another random string...