title: How to get json value in laravel 5.7?
body: <p>I have two tables in a database, <code>package</code> and <code>categories</code>.</p>
  
  <p><code>package</code> has a field <code>category_id</code> that contains data in this form <code>["1","11"]</code> and shows <code>categories</code> data in the form of a checkbox.  </p>
  
  <p>Now, I want all the data from <code>package</code> where <code>category_id</code> equal to <code>categories</code> <code>id</code>.</p>
  
  <p>Here's my code :</p>
  
  <pre><code>public function archive_packages(Request $request, $slug){
      $title='Archive Packages';
      $para='';
      $slugs='archive-packages';
      $categoryRow = Category::where('slug',$slug)-&gt;first();
      $categoryID = $categoryRow-&gt;id;
      $package = Packages::whereRaw('JSON_CONTAINS(category_id, \'["11"]\')')-&gt;get();
      dd($package);
      return view('pages.archive-packages',compact('title','para','slugs','package'));
  }
  </code></pre>
  
  <p>I'm getting the following error :</p>
  
  <blockquote>
    <p>SQLSTATE[42000]: Syntax error or access violation: 1305 FUNCTION<br>
    pre.JSON_CONTAINS does not exist (SQL: select * from `packages` where<br>
    JSON_CONTAINS(category_id, '["11"]'))</p>
  </blockquote>