title: Unable to pass the required parameters into the URL - Laravel Inertia Vue
body: <p>I am building a datatable with multi-column sorting functionality. As up to now, the sorting functionality is working fine, what I am unable to get is, right parameters into the url. As I am only passing <code>$sorts</code> to the component, as a prop, hence I'm using <code>this.$inertia.get</code> to pass the <code>$sorts</code> back to the controller, which is returning back the sorted data. But due to passing <code>sorts: this.sorts</code> within the Inertia get method, its returning back the url query as <code>http://127.0.0.1:8000/users?sorts[name]=asc</code>. How can I get the required parameter within the Inertia get method so I get a url query as such<code>http://127.0.0.1:8000/users?sort_field=name&amp;sort_direction=asc</code> as well as pass the <code>$sorts</code> as well so it returns back the expected data.</p>
  <p><img src="https://user-images.githubusercontent.com/65024122/115411370-0a8ba600-a211-11eb-8bca-cf2dfd3a18f7.gif" alt="sorting" /></p>
  <p>Controller</p>
  <pre><code>public $sorts = [];
  
  public function initalizeSortingRequest()
  {
      $this-&gt;sorts = request()-&gt;get('sorts', $this-&gt;sorts);
  }
  
  public function applySorting($query)
  {
      foreach ($this-&gt;sorts as $sort_field =&gt; $sort_direction) {
          $query-&gt;orderBy($sort_field, $sort_direction);
      }
          
      return $query;
  }
  </code></pre>
  <p>Component</p>
  <pre><code>&lt;script &gt;
      methods: {
          sortBy(field) {
              if (!this.sorts[field]) {
                  this.sorts[field] = 'asc';
              } else if (this.sorts[field] == 'asc') {
                  this.sorts[field] = 'desc';
              } else {
                  delete this.sorts[field];
              }
  
              let route = this.route('users.index', {
                  sorts: this.sorts
              })
              this.$inertia.get(route, {}, {
                  only: ['usersData'],
                  preserveState: true,
                  preserveScroll: true
              })
          }
      } 
  &lt;/script&gt;
  </code></pre>