Skip to content

Commit

Permalink
Remove wizard data with done view
Browse files Browse the repository at this point in the history
  • Loading branch information
ycs77 committed Jun 20, 2019
1 parent cdf6fa4 commit 345f018
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 27 deletions.
23 changes: 1 addition & 22 deletions resources/views/done.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,8 @@

@section('content')
<div class="container my-3">
<h1 class="text-center mb-4">
<h1 class="text-center">
{{ __($doneText ?? 'wizard::generic.done') }}
</h1>

@isset ($wizardData)
<div class="row justify-content-center mt-3">
<div class="col-md-8">
<ul class="list-group">
@foreach ($wizardData as $slug => $stepData)
@if ($stepRepo->find($slug))
<li class="list-group-item">
<h3 class="mb-1">{{ $stepRepo->find($slug)->label() }}</h3>
<ul class="list-unstyled {{ $loop->last ? 'mb-0' : '' }}">
@foreach ($stepData as $key => $data)
<li>{{ $key }}: {{ $data }}</li>
@endforeach
</ul>
</li>
@endif
@endforeach
</ul>
</div>
</div>
@endisset
</div>
@endsection
6 changes: 1 addition & 5 deletions src/Http/Controllers/WizardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,10 @@ public function store(Request $request, string $step)
*/
public function done(Request $request)
{
$wizardData = $request->session()->get('wizard_data');
$wizardData = json_decode(base64_decode($wizardData), true);
$stepRepo = $this->wizard()->stepRepo();
$doneText = $this->doneText;

return view($this->getViewPath('done'), compact('wizardData', 'stepRepo', 'doneText'));
return view($this->getViewPath('done'), compact('stepRepo', 'doneText'));
}

/**
Expand Down Expand Up @@ -251,8 +249,6 @@ protected function redirectTo()
*/
protected function doneRedirectTo($withData = null)
{
$withData = $withData ? base64_encode(json_encode($withData)) : null;
session()->put('wizard_data', $withData);
return redirect($this->getActionUrl('done'));
}

Expand Down

0 comments on commit 345f018

Please sign in to comment.