json(array_merge([ 'type' => 'success' ], $data)); } public function error($data = [], $statusCode = 400) { return response()->json(array_merge([ 'type' => 'error' ], $data), $statusCode); } }