Using jquery within a blade in Filament

I want to be able to do some stuff that requires jquery. I have done the following:

  • downloaded jquery and placed it in
    __DIR__ . '/../../resources/js/jquery-3.7.1.min.js
  • registered it in
    AppServiceProvider
    thus:
public function boot(): void { FilamentAsset::register([ Js::make('jquery', __DIR__ . '/../../resources/js/jquery-3.7.1.min.js'), ]); }

  • ran
    php artisan filament:assets
    and can see that jquery.js is now present in public/app/js
I have this very simple blade content (
doclink.blade.php
) :


<div> <!-- Test Button to trigger jQuery --> <button type="button" class="btn btn-primary" id="testButton"> jquery Button </button> </div> <!-- jQuery Test Script --> <script> $(document).ready(function() { $('#testButton').click(function() { alert('jQuery is working!'); }); }); </script>


Q: is this valid within a blade? The blade is referenced by a custom column which is defined within my resource as

        return $table
            ->defaultGroup('folder')
            ->columns([

                doclink::make(name: 'file_id'),


For clarity, I am seeing the button "jquery btn" displayed - just nothing happens when I click it. Oh and I have verified that jquery is being loaded (see image).

So... what obvious thing am I missing here..?

thx!
j
image.png
Was this page helpful?