title: How to make visible hidden attributes in laravel queryBuilder?
body: <p>Im working on a laravel project which is using innertia, vue stack. In my project some models have hidden attributes. I want to make visible them in some routes. But i cant use makeVisible() with query builder. is there a solution for this?</p>
  <p><em><strong>method in controller</strong></em></p>
  <pre class="lang-php prettyprint-override"><code>    $hosters = Hoster::query()
              -&gt;when($request-&gt;input('search'), function ($query, $search) {
                  if ($search == &quot;approved&quot;) {
                      return $query-&gt;where('is_approved', '=', true);
                  } elseif ($search == &quot;notapproved&quot;) {
                      return $query-&gt;where('is_approved', '=', false);
                  }
                  return $query
                      -&gt;where('name', 'like', '%' . $search . '%')
                      -&gt;orWhere('contact_number', 'like', '%' . $search . '%')
                      -&gt;orWhere('email', 'like', '%' . $search . '%');
              })
              -&gt;orderBy('created_at', 'desc')
              -&gt;paginate(8)
              -&gt;withQueryString();
  
          return Inertia::render('Hoster/Show', [
              'hosters' =&gt; $hosters,
              'filters' =&gt; $request-&gt;only(['search']),
          ]);
  </code></pre>
  <p><em><strong>hidden fields in model</strong></em></p>
  <pre class="lang-php prettyprint-override"><code>    protected $hidden = [
          'past_works',
          'anchor',
          'contact_number',
          'email'
      ];
  </code></pre>