title: I have array in database field and want to search like devices where 5G is Yes value using Query Builder Laravel and display Products in view Laravel
body: <p>I have a column in database in which I store an array to store device specification in an array I think its array in a array now i want to get devices where for example technology 5G is Yes Value here is the below code and database entry of array</p>
  <p>Array Of Specs in database</p>
  <p>a:12:{s:6:&quot;Launch&quot;;a:2:{s:9:&quot;Announced&quot;;s:12:&quot;2019, August&quot;;s:6:&quot;Status&quot;;s:9:&quot;Available&quot;;}s:7:&quot;Network&quot;;a:7:{s:10:&quot;Technology&quot;;s:35:&quot;GSM / CDMA / HSPA / EVDO / LTE / 5G&quot;;s:2:&quot;3G&quot;;s:3:&quot;Yes&quot;;s:2:&quot;4G&quot;;s:3:&quot;Yes&quot;;s:2:&quot;5G&quot;;s:3:&quot;Yes&quot;;s:5:&quot;Speed&quot;;s:69:&quot;HSPA 42.2/5.76 Mbps, LTE-A (7CA) Cat20 2048/150 Mbps, 5G (2+ Gbps DL)&quot;;s:4:&quot;Edge&quot;;s:3:&quot;Yes&quot;;s:4:&quot;GPRS&quot;;s:3:&quot;Yes&quot;;}s:4:&quot;Body&quot;;a:5:{s:10:&quot;Dimensions&quot;;s:45:&quot;162.3 x 77.2 x 7.9 mm (6.39 x 3.04 x 0.31 in)&quot;;s:6:&quot;Weight&quot;;s:15:&quot;198 g (6.98 oz)&quot;;s:3:&quot;SIM&quot;;s:3:&quot;Yes&quot;;s:5:&quot;Build&quot;;s:75:&quot;Glass front (Gorilla Glass 6), glass back (Gorilla Glass 6), aluminum frame&quot;;s:6:&quot;Others&quot;;s:143:&quot;Samsung Pay (Visa, MasterCard certified) IP68 dust/water resistant (up to 1.5m for 30 mins) Stylus (Bluetooth integration, accelerometer, gyro)&quot;;}s:7:&quot;Display&quot;;a:6:{s:4:&quot;Type&quot;;s:49:&quot;Dynamic AMOLED capacitive touchscreen, 16M colors&quot;;s:4:&quot;Size&quot;;s:51:&quot;6.8 inches, 114.0 cm2 (~91.0% screen-to-body ratio)&quot;;s:10:&quot;Resolution&quot;;s:49:&quot;1440 x 3040 pixels, 19:9 ratio (~498 ppi density)&quot;;s:10:&quot;Multitouch&quot;;s:3:&quot;Yes&quot;;s:10:&quot;Protection&quot;;s:23:&quot;Corning Gorilla Glass 6&quot;;s:6:&quot;Others&quot;;s:25:&quot;HDR10+, Always-on display&quot;;}s:8:&quot;Platform&quot;;a:4:{s:2:&quot;OS&quot;;s:60:&quot;Android 9.0 (Pie), planned upgrade to Android 10.0; One UI 2&quot;;s:7:&quot;Chipset&quot;;s:31:&quot;Exynos 9825 (7 nm) - EMEA/LATAM&quot;;s:3:&quot;CPU&quot;;s:80:&quot;Octa-core (2x2.73 GHz Mongoose M4 &amp; 2x2.4 GHz Cortex-A75 &amp; 4x1.9 GHz Cortex-A55)&quot;;s:3:&quot;GPU&quot;;s:26:&quot;Mali-G76 MP12 - EMEA/LATAM&quot;;}s:6:&quot;Memory&quot;;a:2:{s:9:&quot;Card Slot&quot;;s:36:&quot;microSD, up to 1 TB (dedicated slot)&quot;;s:8:&quot;Internal&quot;;s:30:&quot;256GB 12GB RAM, 512GB 12GB RAM&quot;;}s:6:&quot;Camera&quot;;a:4:{s:7:&quot;Primary&quot;;s:68:&quot;12 MP, f/1.5-2.4, 27mm (wide), 1/2.55&quot;, 1.4µm, Dual Pixel PDAF, OIS&quot;;s:8:&quot;Features&quot;;s:29:&quot;LED flash, auto-HDR, panorama&quot;;s:5:&quot;Video&quot;;s:107:&quot;2160p@30/60fps, 1080p@30/60/240fps, 720p@960fps, HDR10+, dual-video rec., stereo sound rec., gyro-EIS &amp; OIS&quot;;s:9:&quot;Secondary&quot;;s:57:&quot;10 MP, f/2.2, 26mm (wide), 1/3&quot;, 1.22µm, Dual Pixel PDAF&quot;;}s:5:&quot;Sound&quot;;a:4:{s:11:&quot;Alert types&quot;;N;s:11:&quot;Loudspeaker&quot;;s:3:&quot;Yes&quot;;s:9:&quot;3.5mmJack&quot;;s:3:&quot;Yes&quot;;s:6:&quot;Others&quot;;s:95:&quot;32-bit/384kHz audio Active noise cancellation with dedicated mic Dolby Atmos sound Tuned by AKG&quot;;}s:5:&quot;Comms&quot;;a:6:{s:4:&quot;WLAN&quot;;s:60:&quot;Wi-Fi 802.11 a/b/g/n/ac/ax, dual-band, Wi-Fi Direct, hotspot&quot;;s:9:&quot;Bluetooth&quot;;s:19:&quot;5.0, A2DP, LE, aptX&quot;;s:3:&quot;GPS&quot;;s:38:&quot;Yes, with A-GPS, GLONASS, BDS, GALILEO&quot;;s:3:&quot;NFC&quot;;s:3:&quot;Yes&quot;;s:5:&quot;Radio&quot;;s:28:&quot;FM radio (USA &amp; Canada only)&quot;;s:3:&quot;USB&quot;;s:36:&quot;3.1, Type-C 1.0 reversible connector&quot;;}s:8:&quot;Features&quot;;a:5:{s:7:&quot;Sensors&quot;;s:91:&quot;Fingerprint (under display, ultrasonic), accelerometer, gyro, proximity, compass, barometer&quot;;s:9:&quot;Messaging&quot;;N;s:7:&quot;Browser&quot;;N;s:4:&quot;Java&quot;;N;s:6:&quot;Others&quot;;N;}s:7:&quot;Battery&quot;;a:4:{s:7:&quot;Battery&quot;;s:37:&quot;Non-removable Li-Ion 4300 mAh battery&quot;;s:8:&quot;Stand-by&quot;;N;s:9:&quot;Talk time&quot;;N;s:10:&quot;Music play&quot;;N;}s:4:&quot;Misc&quot;;a:5:{s:6:&quot;Colors&quot;;s:33:&quot;Aura Glow, Aura White, Aura Black&quot;;s:6:&quot;SAR US&quot;;N;s:6:&quot;SAR EU&quot;;N;s:11:&quot;Price group&quot;;s:43:&quot;€ 1,232.07 / $ 1,257.20 / £ 780.00&quot;;s:7:&quot;Website&quot;;N;}}</p>
  <p>Now the Query That i used in controller</p>
  <pre><code> public function technologynetwork(Request $request)
      {
          $tech = $request-&gt;a;
  //        return $tech;
  
          $devices = DB::table('devices')
              -&gt;select('devices.*')
              -&gt;from('devices', 'specs_array')
              -&gt;where('specs_array','===', array_search(&quot;Yes&quot;,specs_array))
              -&gt;orderBy('release_year', 'desc')
              -&gt;orderBy('release_month', 'desc')
              -&gt;orderBy('id', 'desc')
              -&gt;paginate(30);
  
          return view('frontend/'.$this-&gt;config-&gt;template.'/devices', [
              // global variables
              'config' =&gt; $this-&gt;config,
              'template_path' =&gt; $this-&gt;template_path,
              'logged_user_role' =&gt; $this-&gt;logged_user_role ?? NULL,
  
              // page variables
              'devices' =&gt; $devices,
              'count_all' =&gt; $devices-&gt;total(),
          ]);
      }
  </code></pre>
  <p>and my route is in web.php</p>
  <pre><code>Route::get('/spec/{a}', 'Frontend\DevicesController@technologynetwork');
  </code></pre>
  <p>and its frontend</p>
  <pre><code>  &lt;dd&gt;&lt;a href=&quot;{{url('spec/5G')}}&quot;&gt;5G Phones&lt;/a&gt;&lt;/dd&gt;
  </code></pre>
  <p>Anyone who can guide me how i can get any specs wise devices or how to search from an array</p>