Laravel.io
$validator = \Validator::make($request->all(), $this->rules);
        if ($validator->fails()) {
            return response()->json($validator->errors(), 400);
        }

        $survey = new Survey($request->only('title','description','user_id','status'));
        $survey->save();
        if($request->questions){

            $questionsForSave = [];
            foreach ($request->questions as $question)
            {
                $questionsForSave[] = new SurveyQuestion($question);
            }
            $survey->questions()->saveMany($questionsForSave);
        }

        return response()->json($survey, 201);

Please note that all pasted data is publicly available.