© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
1 reply
jjo63

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
__DIR__ . '/../../resources/js/jquery-3.7.1.min.js

- registered it in
AppServiceProvider
AppServiceProvider
thus:

    public function boot(): void
    {


        FilamentAsset::register([
            Js::make('jquery',       __DIR__ . '/../../resources/js/jquery-3.7.1.min.js'),
        ]);
    }
    public function boot(): void
    {


        FilamentAsset::register([
            Js::make('jquery',       __DIR__ . '/../../resources/js/jquery-3.7.1.min.js'),
        ]);
    }


- ran
php artisan filament:assets
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
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>
<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'),
        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
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Using Filament grid in blade view
FilamentFFilament / ❓┊help
2y ago
render a filament table using blade
FilamentFFilament / ❓┊help
3y ago
Filament Table in Blade
FilamentFFilament / ❓┊help
2y ago
render filament table in blade
FilamentFFilament / ❓┊help
2y ago