title: How to fix 'Uncaught TypeError: $(...).daterangepicker is not a function' when add jquery 3.2.1 library in laravel?
body: <p>First, I want to make a datepicker, but when I add the jquery.min.js library I get an error 'daterangepicker is not a function' how to fix it?</p>
  
  <p>I already tried removing the jquery.min.js library but what appeared was 't is not a function'</p>
  
  <p>in pages dashboard blade.php</p>
  
  <pre><code>&lt;div id="reportrange" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc; width: 100%"&gt;
      &lt;i class="fa fa-calendar"&gt;&lt;/i&gt;&amp;nbsp;
      &lt;span&gt;&lt;/span&gt; &lt;i class="fa fa-caret-down"&gt;&lt;/i&gt;
  &lt;/div&gt;
  
  &lt;canvas id="myChart"&gt;&lt;/canvas&gt;
  
  
  &lt;script type="text/javascript"&gt;
  $(function() {
  
      var start = moment().subtract(29, 'days');
      var end = moment();
  
      function cb(start, end) {
          $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
      }
  
      $('#reportrange').daterangepicker({
          startDate: start,
          endDate: end,
          ranges: {
             'Today': [moment(), moment()],
             'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
             'Last 7 Days': [moment().subtract(6, 'days'), moment()],
             'Last 30 Days': [moment().subtract(29, 'days'), moment()],
             'This Month': [moment().startOf('month'), moment().endOf('month')],
             'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
          }
      }, cb);
  
      cb(start, end);
  });
  &lt;/script&gt;
  
  &lt;script&gt;
      $(function() {
          var ctx = document.getElementById('myChart').getContext('2d');
          var chart = new Chart(ctx, {
              type: 'line',
  
              data: {
                  labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
                  datasets: [{
                      label: 'My First dataset',
                      backgroundColor: 'rgb(255, 99, 132)',
                      borderColor: 'rgb(255, 99, 132)',
                      data: [0, 10, 5, 2, 20, 30, 45]
                  }]
              },
  
              // Configuration options go here
              options: {}
          });
  
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>this is dashboard.php  to call function lib</p>
  
  <pre><code> public function dashboard()
      {
          $pages['view'] = 'pages.dashboard.dashboard';
  
  
          $data['css'] = $this-&gt;css_dashboard();
          $data['js'] = $this-&gt;js_dashboard();
          $data['js'] = array_merge($this-&gt;js_dashboard(),[]);
  
          $data['icon'] = 'icon-home';
          $data['parent'] = 'Dashboard';
  
          $data['view'] = $this-&gt;page($pages);
          return $data;
      }
  </code></pre>
  
  <p>and this is controller.php to call library</p>
  
  <pre><code>public function css_dashboard()
      {
          $css = array(
              'jamtangan/css/library/daterangepicker.css',
          );
          return $css;
      }
  
      public function js_dashboard()
      {
          $js = array(
              'jamtangan/js/library/chart.js',
              'jamtangan/js/library/daterangepicker.min.js',
              'jamtangan/js/library/moment.min.js'
              'jamtangan/js/library/jquery.min.js'
          );
          return $js;
      }
  </code></pre>