File tree Expand file tree Collapse file tree 2 files changed +10
-11
lines changed
Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,10 @@ public function save($closure)
131131 {
132132 // if validation already failed, return stored JsonResponse
133133 if ($ this ->jsonResponse instanceof \Symfony \Component \HttpFoundation \JsonResponse) {
134+ // Send only if not in Laravel environment to avoid double sending
135+ if (!class_exists ('Illuminate\Foundation\Application ' )) {
136+ $ this ->jsonResponse ->send ();
137+ }
134138 return $ this ->jsonResponse ;
135139 }
136140
@@ -146,6 +150,10 @@ public function save($closure)
146150 // delete csrf session token
147151 CsrfToken::unsetToken ();
148152
153+ // Send only if not in Laravel environment to avoid double sending
154+ if (!class_exists ('Illuminate\Foundation\Application ' )) {
155+ $ response ->send ();
156+ }
149157 return $ response ;
150158 }
151159
Original file line number Diff line number Diff line change 1616 "enum:terms " => 'Accept terms and condition ' ,
1717])->validate (function ($ response ){
1818
19- // return $response->json(1, $response->message);
20-
21- var_dump (
22- $ response ,
23- 'sss '
24- );
25- exit ();
19+ return $ response ->json (1 , $ response ->message );
2620})->save (function ($ response ){
2721 // access the form data
2822 $ param = $ response ->param ;
3327 // message
3428 $ response ->message = "Submitted Successfully " ;
3529
36- dump (
37- // $param->message,
38- $ param ->toArray (),
39- );
30+ return $ response ->json (200 , $ response ->message );
4031});
4132
You can’t perform that action at this time.
0 commit comments