44
55use Inertia \Inertia ;
66use Illuminate \Support \Str ;
7- use Illuminate \Http \Response ;
87use Illuminate \Support \Facades \File ;
9- use Illuminate \Http \RedirectResponse ;
108use Arcanist \Contracts \ResponseRenderer ;
119use Illuminate \Contracts \Support \Renderable ;
1210use Illuminate \Contracts \Support \Responsable ;
11+ use Symfony \Component \HttpFoundation \Response ;
1312use Arcanist \Exception \StepTemplateNotFoundException ;
1413
1514class InertiaResponseRenderer implements ResponseRenderer
@@ -18,8 +17,11 @@ public function __construct(private string $componentBasePath)
1817 {
1918 }
2019
21- public function renderStep (WizardStep $ step , AbstractWizard $ wizard , array $ data = []): Response | Responsable | Renderable
22- {
20+ public function renderStep (
21+ WizardStep $ step ,
22+ AbstractWizard $ wizard ,
23+ array $ data = []
24+ ): Response | Responsable | Renderable {
2325 $ component = $ this ->componentBasePath . '/ ' . Str::studly ($ wizard ::$ slug ) . '/ ' . Str::studly ($ step ->slug );
2426 $ componentPath = resource_path ('js/Pages/ ' . $ component . '.vue ' );
2527
@@ -37,7 +39,7 @@ public function renderStep(WizardStep $step, AbstractWizard $wizard, array $data
3739 return Inertia::render ($ component , $ viewData );
3840 }
3941
40- public function redirect (WizardStep $ step , AbstractWizard $ wizard ): RedirectResponse
42+ public function redirect (WizardStep $ step , AbstractWizard $ wizard ): Response | Responsable | Renderable
4143 {
4244 if (!$ wizard ->exists ()) {
4345 return redirect ()->route ('wizard. ' . $ wizard ::$ slug . '.create ' );
@@ -49,8 +51,11 @@ public function redirect(WizardStep $step, AbstractWizard $wizard): RedirectResp
4951 );
5052 }
5153
52- public function redirectWithError (WizardStep $ step , AbstractWizard $ wizard , ?string $ error = null ): RedirectResponse
53- {
54+ public function redirectWithError (
55+ WizardStep $ step ,
56+ AbstractWizard $ wizard ,
57+ ?string $ error = null
58+ ): Response | Responsable | Renderable {
5459 return redirect ()->route (
5560 'wizard. ' . $ wizard ::$ slug . '.show ' ,
5661 [$ wizard ->getId (), $ step ->slug ]
0 commit comments