Custom theme for a livewire component using a filament resource table

So I used a filament table to populate a livewire component and I'm trying to get it to display a custom theme but it doesn't work
Solution:
I needed to run php artisan filament:install --scaffold --tables npm install...
Jump to solution
9 Replies
Dennis Koch
Dennis Koch8mo ago
Sorry can’t help a „doesn’t work“ without any Information
antiquarian_capsaicin
import { defineConfig } from 'vite'
import laravel, { refreshPaths } from 'laravel-vite-plugin'

export default defineConfig({
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.js', 'resources/css/filament/admin/theme.css'],
refresh: [
...refreshPaths,
'app/Livewire/**',
],
}),
],
})
import { defineConfig } from 'vite'
import laravel, { refreshPaths } from 'laravel-vite-plugin'

export default defineConfig({
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.js', 'resources/css/filament/admin/theme.css'],
refresh: [
...refreshPaths,
'app/Livewire/**',
],
}),
],
})
vite.config.js
@import '/vendor/filament/filament/resources/css/theme.css';

@config 'tailwind.config.js';

#course{
background-color: crimson;
}
@import '/vendor/filament/filament/resources/css/theme.css';

@config 'tailwind.config.js';

#course{
background-color: crimson;
}
theme.css
public static function table(Table $table): Table
{
return $table
->contentGrid([
'md' => 2,
'xl' => 5,
])
->query(ModelCourse::query())
->columns([
Grid::make()
->columns(1)
->schema([
ImageColumn::make('image')
->toggleable()
->circular(),
TextColumn::make('name')
->size(TextColumnSize::Large)
->searchable(),
TextColumn::make('level.name')
->searchable(),
TextColumn::make('cost')
->searchable(),
TextColumn::make('duration')
->searchable(),
TextColumn::make('details')
->searchable()
->toggleable(isToggledHiddenByDefault: true),

])->columns(2)
])

->contentGrid(['md' => 2, 'xl' => '3'])
->groups([
'level.name',
]);

}
public static function table(Table $table): Table
{
return $table
->contentGrid([
'md' => 2,
'xl' => 5,
])
->query(ModelCourse::query())
->columns([
Grid::make()
->columns(1)
->schema([
ImageColumn::make('image')
->toggleable()
->circular(),
TextColumn::make('name')
->size(TextColumnSize::Large)
->searchable(),
TextColumn::make('level.name')
->searchable(),
TextColumn::make('cost')
->searchable(),
TextColumn::make('duration')
->searchable(),
TextColumn::make('details')
->searchable()
->toggleable(isToggledHiddenByDefault: true),

])->columns(2)
])

->contentGrid(['md' => 2, 'xl' => '3'])
->groups([
'level.name',
]);

}
table in livewire component Trying to get it yto display as a grid in the livewire page
Dennis Koch
Dennis Koch8mo ago
That should also work without a theme. Not sure whether it works combined with groups though. What is the issue?
antiquarian_capsaicin
First off, the styling isn't working the way it's supposed to be working. So I was trying to make it work by using a custom theme But the custom theme isn't working too
antiquarian_capsaicin
Displays like this
No description
toeknee
toeknee8mo ago
inspect your console, what is shown
antiquarian_capsaicin
content.build.min.js:1

GET chrome-extension://njgehaondchbmjmajphnhlojfnbfokng/js/contentScripts/dom.js net::ERR_FILE_NOT_FOUND This It's been fixed
Dennis Koch
Dennis Koch8mo ago
What was the issue?
Solution
antiquarian_capsaicin
I needed to run php artisan filament:install --scaffold --tables npm install
Want results from more Discord servers?
Add your server
More Posts
Is it possible to hide edit/delete buttons from table on mobile only lets say only cellphones ?I tried visibleFrom() or hiddenFrom() methods but they do not exist or visibleOn() .. Any advice pleAdd Searchable() to a form select, hide the listHi! I'm trying to implement a select with a relationship all it's ok (very simple) but when i add thhow to load relationship() on Forms\Components\Fieldset conditionally?The form uses `Forms\Components\Fieldset::relationship('primaryAddress')` to load a related 'addresswhere can I set the redirect url after user logout?when user logouts from the user menu in filament v3 dashboard it redirects the user to `/admin/loginPersist toggleable column state between sessionsHello, It is a way to persist the toggled state of a column? Some of my users want to see their datavalidation ->in() rule is not executed when checking against an empty arrayhey guys, we just encountered a problem with the ->in() rule on the form builder. we try to validaHow to align images horizontally, wrap to next line if there is no more space```php SpatieMediaLibraryFileUpload::make('carousel') ->multiple() ->image() ->collectioReload Page after custom action ends.Hi, I have a custom action where i made some changes on the bbdd, and i need to reload the page at tpls Problem of relationshipproblem data not insert in table partner_productTransferring a value from the main form to an optionForm, is this possible?So i have a form where a user can create a malfunction, here he selects first a device (clinic_devic