Laravel - Image Array Validation gives an Error to nullable validate












0















I need to validate my image array as an image and specific image file extensions only. but my request validation to image WONT ALLOW me to use inser nullable values



For example I will add a content and dont want to add images. then the image should contain null that is why i need to have request validation as nullable. But in my experience null value is not allowed and it gives me error why? help me please



here is the error.




The Promotion Image must be an Image




here is my CONTROLLER



 public function store(Request $request)
{
$this->validate($request, [
'promotion_image' => 'image|nullable|max:1999'
]);

$promotion = ;

if ($request->has('promotion_image'))
{
//Handle File Upload

foreach ($request->file('promotion_image') as $key => $file)
{
// Get FileName
$filenameWithExt = $file->getClientOriginalName();
//Get just filename
$filename = pathinfo( $filenameWithExt, PATHINFO_FILENAME);
//Get just extension
$extension = $file->getClientOriginalExtension();
//Filename to Store
$fileNameToStore = $filename.'_'.time().'.'.$extension;
//Upload Image
$path = $file->storeAs('public/promotion_images',$fileNameToStore);
array_push($promotion, $fileNameToStore);
}

$fileNameToStore = serialize($promotion);
}
else
{
$fileNameToStore='noimage.jpg';
}

if (count($promotion)) {
$implodedPromotion = implode(' , ', $promotion);
$promotionImage = new Promotion;
$promotionImage->promotion_image = $implodedPromotion;
$promotionImage->save();

return redirect('/admin/airlineplus/promotions')->with('success', 'Image Inserted');
}

return redirect('/admin/airlineplus/promotions')->with('error', 'Something went wrong.');


}


here is my VIEW



    {!! Form::open(['action'=>'AdminPromotionsController@store', 'method' => 'POST','enctype'=>'multipart/form-data', 'name' => 'add_name', 'id' => 'add_name']) !!}
<div class="form-group">
<div class="table-responsive">
<table class="table table-bordered" id="dynamic_field">
<tr>
<td> {{ Form::file('promotion_image')}}</td>

<td>{{ Form::button('', ['class' => 'btn btn-success fa fa-plus-circle', 'id'=>'add','name'=>'add', 'style'=>'font-size:15px;']) }}</td>
</tr>
</table>
{{Form::submit('submit', ['class'=>'btn btn-primary', 'name'=>'submit'])}}
</div>
</div>
{!! Form::close() !!}









share|improve this question



























    0















    I need to validate my image array as an image and specific image file extensions only. but my request validation to image WONT ALLOW me to use inser nullable values



    For example I will add a content and dont want to add images. then the image should contain null that is why i need to have request validation as nullable. But in my experience null value is not allowed and it gives me error why? help me please



    here is the error.




    The Promotion Image must be an Image




    here is my CONTROLLER



     public function store(Request $request)
    {
    $this->validate($request, [
    'promotion_image' => 'image|nullable|max:1999'
    ]);

    $promotion = ;

    if ($request->has('promotion_image'))
    {
    //Handle File Upload

    foreach ($request->file('promotion_image') as $key => $file)
    {
    // Get FileName
    $filenameWithExt = $file->getClientOriginalName();
    //Get just filename
    $filename = pathinfo( $filenameWithExt, PATHINFO_FILENAME);
    //Get just extension
    $extension = $file->getClientOriginalExtension();
    //Filename to Store
    $fileNameToStore = $filename.'_'.time().'.'.$extension;
    //Upload Image
    $path = $file->storeAs('public/promotion_images',$fileNameToStore);
    array_push($promotion, $fileNameToStore);
    }

    $fileNameToStore = serialize($promotion);
    }
    else
    {
    $fileNameToStore='noimage.jpg';
    }

    if (count($promotion)) {
    $implodedPromotion = implode(' , ', $promotion);
    $promotionImage = new Promotion;
    $promotionImage->promotion_image = $implodedPromotion;
    $promotionImage->save();

    return redirect('/admin/airlineplus/promotions')->with('success', 'Image Inserted');
    }

    return redirect('/admin/airlineplus/promotions')->with('error', 'Something went wrong.');


    }


    here is my VIEW



        {!! Form::open(['action'=>'AdminPromotionsController@store', 'method' => 'POST','enctype'=>'multipart/form-data', 'name' => 'add_name', 'id' => 'add_name']) !!}
    <div class="form-group">
    <div class="table-responsive">
    <table class="table table-bordered" id="dynamic_field">
    <tr>
    <td> {{ Form::file('promotion_image')}}</td>

    <td>{{ Form::button('', ['class' => 'btn btn-success fa fa-plus-circle', 'id'=>'add','name'=>'add', 'style'=>'font-size:15px;']) }}</td>
    </tr>
    </table>
    {{Form::submit('submit', ['class'=>'btn btn-primary', 'name'=>'submit'])}}
    </div>
    </div>
    {!! Form::close() !!}









    share|improve this question

























      0












      0








      0








      I need to validate my image array as an image and specific image file extensions only. but my request validation to image WONT ALLOW me to use inser nullable values



      For example I will add a content and dont want to add images. then the image should contain null that is why i need to have request validation as nullable. But in my experience null value is not allowed and it gives me error why? help me please



      here is the error.




      The Promotion Image must be an Image




      here is my CONTROLLER



       public function store(Request $request)
      {
      $this->validate($request, [
      'promotion_image' => 'image|nullable|max:1999'
      ]);

      $promotion = ;

      if ($request->has('promotion_image'))
      {
      //Handle File Upload

      foreach ($request->file('promotion_image') as $key => $file)
      {
      // Get FileName
      $filenameWithExt = $file->getClientOriginalName();
      //Get just filename
      $filename = pathinfo( $filenameWithExt, PATHINFO_FILENAME);
      //Get just extension
      $extension = $file->getClientOriginalExtension();
      //Filename to Store
      $fileNameToStore = $filename.'_'.time().'.'.$extension;
      //Upload Image
      $path = $file->storeAs('public/promotion_images',$fileNameToStore);
      array_push($promotion, $fileNameToStore);
      }

      $fileNameToStore = serialize($promotion);
      }
      else
      {
      $fileNameToStore='noimage.jpg';
      }

      if (count($promotion)) {
      $implodedPromotion = implode(' , ', $promotion);
      $promotionImage = new Promotion;
      $promotionImage->promotion_image = $implodedPromotion;
      $promotionImage->save();

      return redirect('/admin/airlineplus/promotions')->with('success', 'Image Inserted');
      }

      return redirect('/admin/airlineplus/promotions')->with('error', 'Something went wrong.');


      }


      here is my VIEW



          {!! Form::open(['action'=>'AdminPromotionsController@store', 'method' => 'POST','enctype'=>'multipart/form-data', 'name' => 'add_name', 'id' => 'add_name']) !!}
      <div class="form-group">
      <div class="table-responsive">
      <table class="table table-bordered" id="dynamic_field">
      <tr>
      <td> {{ Form::file('promotion_image')}}</td>

      <td>{{ Form::button('', ['class' => 'btn btn-success fa fa-plus-circle', 'id'=>'add','name'=>'add', 'style'=>'font-size:15px;']) }}</td>
      </tr>
      </table>
      {{Form::submit('submit', ['class'=>'btn btn-primary', 'name'=>'submit'])}}
      </div>
      </div>
      {!! Form::close() !!}









      share|improve this question














      I need to validate my image array as an image and specific image file extensions only. but my request validation to image WONT ALLOW me to use inser nullable values



      For example I will add a content and dont want to add images. then the image should contain null that is why i need to have request validation as nullable. But in my experience null value is not allowed and it gives me error why? help me please



      here is the error.




      The Promotion Image must be an Image




      here is my CONTROLLER



       public function store(Request $request)
      {
      $this->validate($request, [
      'promotion_image' => 'image|nullable|max:1999'
      ]);

      $promotion = ;

      if ($request->has('promotion_image'))
      {
      //Handle File Upload

      foreach ($request->file('promotion_image') as $key => $file)
      {
      // Get FileName
      $filenameWithExt = $file->getClientOriginalName();
      //Get just filename
      $filename = pathinfo( $filenameWithExt, PATHINFO_FILENAME);
      //Get just extension
      $extension = $file->getClientOriginalExtension();
      //Filename to Store
      $fileNameToStore = $filename.'_'.time().'.'.$extension;
      //Upload Image
      $path = $file->storeAs('public/promotion_images',$fileNameToStore);
      array_push($promotion, $fileNameToStore);
      }

      $fileNameToStore = serialize($promotion);
      }
      else
      {
      $fileNameToStore='noimage.jpg';
      }

      if (count($promotion)) {
      $implodedPromotion = implode(' , ', $promotion);
      $promotionImage = new Promotion;
      $promotionImage->promotion_image = $implodedPromotion;
      $promotionImage->save();

      return redirect('/admin/airlineplus/promotions')->with('success', 'Image Inserted');
      }

      return redirect('/admin/airlineplus/promotions')->with('error', 'Something went wrong.');


      }


      here is my VIEW



          {!! Form::open(['action'=>'AdminPromotionsController@store', 'method' => 'POST','enctype'=>'multipart/form-data', 'name' => 'add_name', 'id' => 'add_name']) !!}
      <div class="form-group">
      <div class="table-responsive">
      <table class="table table-bordered" id="dynamic_field">
      <tr>
      <td> {{ Form::file('promotion_image')}}</td>

      <td>{{ Form::button('', ['class' => 'btn btn-success fa fa-plus-circle', 'id'=>'add','name'=>'add', 'style'=>'font-size:15px;']) }}</td>
      </tr>
      </table>
      {{Form::submit('submit', ['class'=>'btn btn-primary', 'name'=>'submit'])}}
      </div>
      </div>
      {!! Form::close() !!}






      php mysql arrays laravel laravel-5






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 25 '18 at 14:02







      user10701881































          2 Answers
          2






          active

          oldest

          votes


















          1














          No need to add nullable attribute in the validation. just change your validation code like this



          $this->validate($request, [
          'promotion_image.*' => 'image|max:1999'
          ]);


          If you need user must add image input then you can use required validation rule other wise you don't need such thing.



          Above code forces user to add file of type image or nothing at all.



          I hope you understand and if any explanation needed, feel free to ask.






          share|improve this answer


























          • what if I have 3 forms to insert and I dont want to add all the other 2 forms an image how can I submit that without any errors?

            – user10701881
            Nov 25 '18 at 14:08











          • @obitouchiha Three forms ? or three image input fields

            – Sagar Gautam
            Nov 25 '18 at 14:09











          • and also what if I want to update 3 images.. and i dont want to touch the other 2 images .. i only want to update one image. how can i set that without catching any error?

            – user10701881
            Nov 25 '18 at 14:09











          • sorry 3 input fields..

            – user10701881
            Nov 25 '18 at 14:10











          • sir.. even tho i set it to 'image|max:1999' only it gives me an error :( The promotion image must be an image.

            – user10701881
            Nov 25 '18 at 14:11



















          0














          You need to validate it as an array:



          $validator = Validator::make($request->all(), [
          'photos.profile' => 'required|image',
          ]);


          Take a look laravel docs



          you may want to combine it with sometimes which indicates that the current validation rules will apply only if the field is present.






          share|improve this answer
























          • where did you get 'photos.profile' ??

            – user10701881
            Nov 25 '18 at 14:23











          • hey sir. i think you are correct but it throws me an error here it is Validator' not found

            – user10701881
            Nov 25 '18 at 14:24











          • it is just an example man, For you case i think it is promotion_image.* as you don't know how many images you my have. According to you comment in [what if I have 3 forms to insert and I dont want to add all the other 2 forms an image how can I submit that without any errors? ]. Also you have to import Validator to your class.

            – Vaggelis Ksps
            Nov 25 '18 at 14:25













          • can you help me with the code pls? i dont quiet understand it :(

            – user10701881
            Nov 25 '18 at 14:27











          • Validator is not found :(

            – user10701881
            Nov 25 '18 at 14:28











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53468263%2flaravel-image-array-validation-gives-an-error-to-nullable-validate%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown
























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          No need to add nullable attribute in the validation. just change your validation code like this



          $this->validate($request, [
          'promotion_image.*' => 'image|max:1999'
          ]);


          If you need user must add image input then you can use required validation rule other wise you don't need such thing.



          Above code forces user to add file of type image or nothing at all.



          I hope you understand and if any explanation needed, feel free to ask.






          share|improve this answer


























          • what if I have 3 forms to insert and I dont want to add all the other 2 forms an image how can I submit that without any errors?

            – user10701881
            Nov 25 '18 at 14:08











          • @obitouchiha Three forms ? or three image input fields

            – Sagar Gautam
            Nov 25 '18 at 14:09











          • and also what if I want to update 3 images.. and i dont want to touch the other 2 images .. i only want to update one image. how can i set that without catching any error?

            – user10701881
            Nov 25 '18 at 14:09











          • sorry 3 input fields..

            – user10701881
            Nov 25 '18 at 14:10











          • sir.. even tho i set it to 'image|max:1999' only it gives me an error :( The promotion image must be an image.

            – user10701881
            Nov 25 '18 at 14:11
















          1














          No need to add nullable attribute in the validation. just change your validation code like this



          $this->validate($request, [
          'promotion_image.*' => 'image|max:1999'
          ]);


          If you need user must add image input then you can use required validation rule other wise you don't need such thing.



          Above code forces user to add file of type image or nothing at all.



          I hope you understand and if any explanation needed, feel free to ask.






          share|improve this answer


























          • what if I have 3 forms to insert and I dont want to add all the other 2 forms an image how can I submit that without any errors?

            – user10701881
            Nov 25 '18 at 14:08











          • @obitouchiha Three forms ? or three image input fields

            – Sagar Gautam
            Nov 25 '18 at 14:09











          • and also what if I want to update 3 images.. and i dont want to touch the other 2 images .. i only want to update one image. how can i set that without catching any error?

            – user10701881
            Nov 25 '18 at 14:09











          • sorry 3 input fields..

            – user10701881
            Nov 25 '18 at 14:10











          • sir.. even tho i set it to 'image|max:1999' only it gives me an error :( The promotion image must be an image.

            – user10701881
            Nov 25 '18 at 14:11














          1












          1








          1







          No need to add nullable attribute in the validation. just change your validation code like this



          $this->validate($request, [
          'promotion_image.*' => 'image|max:1999'
          ]);


          If you need user must add image input then you can use required validation rule other wise you don't need such thing.



          Above code forces user to add file of type image or nothing at all.



          I hope you understand and if any explanation needed, feel free to ask.






          share|improve this answer















          No need to add nullable attribute in the validation. just change your validation code like this



          $this->validate($request, [
          'promotion_image.*' => 'image|max:1999'
          ]);


          If you need user must add image input then you can use required validation rule other wise you don't need such thing.



          Above code forces user to add file of type image or nothing at all.



          I hope you understand and if any explanation needed, feel free to ask.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 25 '18 at 14:30

























          answered Nov 25 '18 at 14:06









          Sagar GautamSagar Gautam

          4,33931544




          4,33931544













          • what if I have 3 forms to insert and I dont want to add all the other 2 forms an image how can I submit that without any errors?

            – user10701881
            Nov 25 '18 at 14:08











          • @obitouchiha Three forms ? or three image input fields

            – Sagar Gautam
            Nov 25 '18 at 14:09











          • and also what if I want to update 3 images.. and i dont want to touch the other 2 images .. i only want to update one image. how can i set that without catching any error?

            – user10701881
            Nov 25 '18 at 14:09











          • sorry 3 input fields..

            – user10701881
            Nov 25 '18 at 14:10











          • sir.. even tho i set it to 'image|max:1999' only it gives me an error :( The promotion image must be an image.

            – user10701881
            Nov 25 '18 at 14:11



















          • what if I have 3 forms to insert and I dont want to add all the other 2 forms an image how can I submit that without any errors?

            – user10701881
            Nov 25 '18 at 14:08











          • @obitouchiha Three forms ? or three image input fields

            – Sagar Gautam
            Nov 25 '18 at 14:09











          • and also what if I want to update 3 images.. and i dont want to touch the other 2 images .. i only want to update one image. how can i set that without catching any error?

            – user10701881
            Nov 25 '18 at 14:09











          • sorry 3 input fields..

            – user10701881
            Nov 25 '18 at 14:10











          • sir.. even tho i set it to 'image|max:1999' only it gives me an error :( The promotion image must be an image.

            – user10701881
            Nov 25 '18 at 14:11

















          what if I have 3 forms to insert and I dont want to add all the other 2 forms an image how can I submit that without any errors?

          – user10701881
          Nov 25 '18 at 14:08





          what if I have 3 forms to insert and I dont want to add all the other 2 forms an image how can I submit that without any errors?

          – user10701881
          Nov 25 '18 at 14:08













          @obitouchiha Three forms ? or three image input fields

          – Sagar Gautam
          Nov 25 '18 at 14:09





          @obitouchiha Three forms ? or three image input fields

          – Sagar Gautam
          Nov 25 '18 at 14:09













          and also what if I want to update 3 images.. and i dont want to touch the other 2 images .. i only want to update one image. how can i set that without catching any error?

          – user10701881
          Nov 25 '18 at 14:09





          and also what if I want to update 3 images.. and i dont want to touch the other 2 images .. i only want to update one image. how can i set that without catching any error?

          – user10701881
          Nov 25 '18 at 14:09













          sorry 3 input fields..

          – user10701881
          Nov 25 '18 at 14:10





          sorry 3 input fields..

          – user10701881
          Nov 25 '18 at 14:10













          sir.. even tho i set it to 'image|max:1999' only it gives me an error :( The promotion image must be an image.

          – user10701881
          Nov 25 '18 at 14:11





          sir.. even tho i set it to 'image|max:1999' only it gives me an error :( The promotion image must be an image.

          – user10701881
          Nov 25 '18 at 14:11













          0














          You need to validate it as an array:



          $validator = Validator::make($request->all(), [
          'photos.profile' => 'required|image',
          ]);


          Take a look laravel docs



          you may want to combine it with sometimes which indicates that the current validation rules will apply only if the field is present.






          share|improve this answer
























          • where did you get 'photos.profile' ??

            – user10701881
            Nov 25 '18 at 14:23











          • hey sir. i think you are correct but it throws me an error here it is Validator' not found

            – user10701881
            Nov 25 '18 at 14:24











          • it is just an example man, For you case i think it is promotion_image.* as you don't know how many images you my have. According to you comment in [what if I have 3 forms to insert and I dont want to add all the other 2 forms an image how can I submit that without any errors? ]. Also you have to import Validator to your class.

            – Vaggelis Ksps
            Nov 25 '18 at 14:25













          • can you help me with the code pls? i dont quiet understand it :(

            – user10701881
            Nov 25 '18 at 14:27











          • Validator is not found :(

            – user10701881
            Nov 25 '18 at 14:28
















          0














          You need to validate it as an array:



          $validator = Validator::make($request->all(), [
          'photos.profile' => 'required|image',
          ]);


          Take a look laravel docs



          you may want to combine it with sometimes which indicates that the current validation rules will apply only if the field is present.






          share|improve this answer
























          • where did you get 'photos.profile' ??

            – user10701881
            Nov 25 '18 at 14:23











          • hey sir. i think you are correct but it throws me an error here it is Validator' not found

            – user10701881
            Nov 25 '18 at 14:24











          • it is just an example man, For you case i think it is promotion_image.* as you don't know how many images you my have. According to you comment in [what if I have 3 forms to insert and I dont want to add all the other 2 forms an image how can I submit that without any errors? ]. Also you have to import Validator to your class.

            – Vaggelis Ksps
            Nov 25 '18 at 14:25













          • can you help me with the code pls? i dont quiet understand it :(

            – user10701881
            Nov 25 '18 at 14:27











          • Validator is not found :(

            – user10701881
            Nov 25 '18 at 14:28














          0












          0








          0







          You need to validate it as an array:



          $validator = Validator::make($request->all(), [
          'photos.profile' => 'required|image',
          ]);


          Take a look laravel docs



          you may want to combine it with sometimes which indicates that the current validation rules will apply only if the field is present.






          share|improve this answer













          You need to validate it as an array:



          $validator = Validator::make($request->all(), [
          'photos.profile' => 'required|image',
          ]);


          Take a look laravel docs



          you may want to combine it with sometimes which indicates that the current validation rules will apply only if the field is present.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 25 '18 at 14:21









          Vaggelis KspsVaggelis Ksps

          190110




          190110













          • where did you get 'photos.profile' ??

            – user10701881
            Nov 25 '18 at 14:23











          • hey sir. i think you are correct but it throws me an error here it is Validator' not found

            – user10701881
            Nov 25 '18 at 14:24











          • it is just an example man, For you case i think it is promotion_image.* as you don't know how many images you my have. According to you comment in [what if I have 3 forms to insert and I dont want to add all the other 2 forms an image how can I submit that without any errors? ]. Also you have to import Validator to your class.

            – Vaggelis Ksps
            Nov 25 '18 at 14:25













          • can you help me with the code pls? i dont quiet understand it :(

            – user10701881
            Nov 25 '18 at 14:27











          • Validator is not found :(

            – user10701881
            Nov 25 '18 at 14:28



















          • where did you get 'photos.profile' ??

            – user10701881
            Nov 25 '18 at 14:23











          • hey sir. i think you are correct but it throws me an error here it is Validator' not found

            – user10701881
            Nov 25 '18 at 14:24











          • it is just an example man, For you case i think it is promotion_image.* as you don't know how many images you my have. According to you comment in [what if I have 3 forms to insert and I dont want to add all the other 2 forms an image how can I submit that without any errors? ]. Also you have to import Validator to your class.

            – Vaggelis Ksps
            Nov 25 '18 at 14:25













          • can you help me with the code pls? i dont quiet understand it :(

            – user10701881
            Nov 25 '18 at 14:27











          • Validator is not found :(

            – user10701881
            Nov 25 '18 at 14:28

















          where did you get 'photos.profile' ??

          – user10701881
          Nov 25 '18 at 14:23





          where did you get 'photos.profile' ??

          – user10701881
          Nov 25 '18 at 14:23













          hey sir. i think you are correct but it throws me an error here it is Validator' not found

          – user10701881
          Nov 25 '18 at 14:24





          hey sir. i think you are correct but it throws me an error here it is Validator' not found

          – user10701881
          Nov 25 '18 at 14:24













          it is just an example man, For you case i think it is promotion_image.* as you don't know how many images you my have. According to you comment in [what if I have 3 forms to insert and I dont want to add all the other 2 forms an image how can I submit that without any errors? ]. Also you have to import Validator to your class.

          – Vaggelis Ksps
          Nov 25 '18 at 14:25







          it is just an example man, For you case i think it is promotion_image.* as you don't know how many images you my have. According to you comment in [what if I have 3 forms to insert and I dont want to add all the other 2 forms an image how can I submit that without any errors? ]. Also you have to import Validator to your class.

          – Vaggelis Ksps
          Nov 25 '18 at 14:25















          can you help me with the code pls? i dont quiet understand it :(

          – user10701881
          Nov 25 '18 at 14:27





          can you help me with the code pls? i dont quiet understand it :(

          – user10701881
          Nov 25 '18 at 14:27













          Validator is not found :(

          – user10701881
          Nov 25 '18 at 14:28





          Validator is not found :(

          – user10701881
          Nov 25 '18 at 14:28


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53468263%2flaravel-image-array-validation-gives-an-error-to-nullable-validate%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          To store a contact into the json file from server.js file using a class in NodeJS

          Redirect URL with Chrome Remote Debugging Android Devices

          Dieringhausen