title: Foreach loop is showing error on adding members in group
body: <p>I am trying to create a group using Postman. What I am doing is, I am adding group name and members in it. Firstly I am adding name in one table and adding the id of that group with members in another table. But don't know why its creating error in Foreach Loop .i.e <code>Invalid argument supplied for foreach()</code></p>
  <p>Here is my code in controller:</p>
  <pre><code>public function createGroup(Request $request)
  {
      $rules = [
          'name'=&gt;'required',
      ];
  
      $result = $this-&gt;validate_request($request-&gt;all(), $rules);
      if(!empty($result)) return $this-&gt;sendErrorResponse($result);  
  
      $user_id = request('user_id');
      $member = request('member');
  
      $data = array(
          'name'=&gt;$request-&gt;name,  
      );
  
      $group = Group::create($data);
  
      if($group-&gt;id)
      {      
          foreach($member as $m)
          {
              GroupUser::create([
                  'group_id' =&gt; $group-&gt;id,
                  'user_id' =&gt; $m,
                  'status' =&gt; 0,
              ]);
          }                
          
          return $this-&gt;sendSuccessResponse([
              'message'=&gt;ResponseMessage::statusResponses(ResponseMessage::_STATUS_REGISTRATION_SUCCESS)
          ]);
      }
  }
  </code></pre>
  <p>Please let me know, where I am missing</p>
  <p><a href="https://i.stack.imgur.com/t3fJI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/t3fJI.png" alt="enter image description here" /></a></p>