title: Laravel 6 - @push and @stack
body: <p>Hello everyone I'm new to Laravel and I'm currently using Laravel 6.0</p>
  
  <p>For some reason my javascript using @push is not working. The script only works when I paste the code in the blade file and not using the asset folder.</p>
  
  <p><strong>add.blade.php</strong></p>
  
  <pre><code>@extends('layouts.app')
  @section('content')
  // Long HTML code
  @endsection
  
  @push('scripts')
  &lt;script src="{{ asset('js/position.js') }}"&gt;&lt;/script&gt;
  @endpush
  </code></pre>
  
  <p><strong>layouts > app.blade.php</strong></p>
  
  <pre><code> &lt;main class="py-4"&gt;
        @yield('content')
      &lt;/main&gt;
    &lt;/div&gt;
    @stack('scripts')
  &lt;/body&gt;
  </code></pre>
  
  <p><strong>public(asset) > js > position.js</strong></p>
  
  <pre><code> $('#department').change(function(){
      var departmentID = $(this).val();    
  
          if(departmentID) {
          $.ajax({
          type:"GET",
          url:"{{url('get-section-list-position')}}?department_id="+departmentID,
          success:function(res){               
              if(res) {
              $("#section").empty();
              $("#section").append('&lt;option&gt;Please Select Section&lt;/option&gt;');
              $.each(res,function(key, value){
              $("#section").append('&lt;option value="'+key+'"&gt;'+value+'&lt;/option&gt;');
            });
            } else {
              $("#section").empty();
            }
          }
        });
      } else {
          $("#section").empty();
      }      
    });
  </code></pre>
  
  <p>If I paste the script in the add.blade.php and used @section, it works but I'm afraid that the security of my system would be compromised. Please help.</p>