© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
3 replies
Xiaohou

How to use the resources outside of panel

I'm using filament table on a custom Livewire page, which is working just as expected. However, i found the finished class is just really long and messy.

Especially for the action part, for each table, i need to set up actions for view, create, edit, and delete. Each action will then contain more code such as forms, hooks, notifications, etc... Putting everything inside one function makes the code very hard to read and manage.

public function table(Table $table): Table
    {
         return $table
            ->query(User::query())
            ->columns([
                // columns here
            ])
            ->headerActions([
                // actions here
            ])
            ->actions([
                // more actions here
            ]);
    }
public function table(Table $table): Table
    {
         return $table
            ->query(User::query())
            ->columns([
                // columns here
            ])
            ->headerActions([
                // actions here
            ])
            ->actions([
                // more actions here
            ]);
    }


I then found out you can generate filament resources for the model under panel section, it has the information needed to render table and form, also individual pages to view, create, edit, and delete the model. It would make the table function much cleaner and easier to manage if I can use the resources class from filament. I did get the resources to works inside filament panel, but i cant get it working inside my custom Livewire component.

To be more specific, the data table works fine. But none of the action works, it opens empty modal. Would be much appriciate if someone could point me in the right direction.

The Livewire class
<?php

namespace App\Livewire\UserTable;

use App\Filament\Resources\UserResource;

public function table(Table $table): Table
{
   return UserResource::table($table);
} 
<?php

namespace App\Livewire\UserTable;

use App\Filament\Resources\UserResource;

public function table(Table $table): Table
{
   return UserResource::table($table);
} 


The Livewire view
<div>
    {{ $this->table }}
</div>
<div>
    {{ $this->table }}
</div>
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

How to use filament notification outside the panel
FilamentFFilament / ❓┊help
12mo ago
Use Filament layout/design outside of the panel
FilamentFFilament / ❓┊help
3y ago
How to place language switcher outside of panel
FilamentFFilament / ❓┊help
2y ago