@@ -19,7 +19,7 @@ public function valid_data_passes_controller_validation()
1919 {
2020 $ survey = Survey::create ();
2121 $ survey ->customfields ()->save (
22- factory ( CustomField::class )->make ([
22+ CustomField::factory ( )->make ([
2323 'title ' => 'email ' ,
2424 'type ' => 'text ' ,
2525 ])
@@ -45,15 +45,15 @@ public function invalid_data_throws_validation_exception()
4545 {
4646 $ survey = Survey::create ();
4747 $ survey ->customfields ()->save (
48- factory ( CustomField::class )->make ([
48+ CustomField::factory ( )->make ([
4949 'title ' => 'favorite_album ' ,
5050 'type ' => 'select ' ,
5151 'answers ' => ['Tha Carter ' , 'Tha Carter II ' , 'Tha Carter III ' ],
5252 ])
5353 );
5454
5555 Route::post ("/surveys/ {$ survey ->id }/responses " , function (Request $ request ) use ($ survey ) {
56- $ validator = $ survey ->validateCustomFields ($ request );
56+ $ validator = $ survey ->validateCustomFields ($ request-> custom_fields );
5757
5858 if ($ validator ->fails ()) {
5959 return ['errors ' => $ validator ->errors ()];
@@ -77,7 +77,7 @@ public function non_required_fields_can_be_left_null_for_validation()
7777 {
7878 $ survey = Survey::create ();
7979 $ survey ->customfields ()->save (
80- factory ( CustomField::class )->make ([
80+ CustomField::factory ( )->make ([
8181 'title ' => 'favorite_album ' ,
8282 'type ' => 'select ' ,
8383 'answers ' => ['Tha Carter ' , 'Tha Carter II ' , 'Tha Carter III ' ],
@@ -111,7 +111,7 @@ public function checkbox_can_pass_validation()
111111 $ survey = Survey::create ();
112112 $ surveyResponse = SurveyResponse::create ();
113113 $ survey ->customfields ()->save (
114- factory ( CustomField::class )->make ([
114+ CustomField::factory ( )->make ([
115115 'title ' => 'favorite_album ' ,
116116 'type ' => 'checkbox ' ,
117117 ])
@@ -147,7 +147,7 @@ public function fields_can_be_saved_from_request_with_convenience_method()
147147 $ survey = Survey::create ();
148148 $ surveyResponse = SurveyResponse::create ();
149149 $ survey ->customfields ()->save (
150- factory ( CustomField::class )->make ([
150+ CustomField::factory ( )->make ([
151151 'title ' => 'favorite_album ' ,
152152 'type ' => 'select ' ,
153153 'answers ' => ['Tha Carter ' , 'Tha Carter II ' , 'Tha Carter III ' ],
0 commit comments