friese
friese
FFilament
Created by friese on 10/20/2023 in #❓┊help
How to develop JS?
I try to add a bit of javascript to one of my forms using this way: https://filamentphp.com/docs/3.x/support/assets#lazy-loading-javascript Right now I have to manually publish my JS-File after every change with artisan filament:assets Is there a way that this can be done automatically with a watcher?
5 replies
FFilament
Created by friese on 10/12/2023 in #❓┊help
Tailwind content detection in custom theme not working
I setup a fresh installation of laravel 10 and filament 3. Unfortunately I can't get the custom theme to work properly to get access to all the tailwind css classes. I followed the steps in the documentation (https://filamentphp.com/docs/3.x/panels/themes#creating-a-custom-theme) to create a custom theme. But when I run the build script (sail npm run build), I get this warning, and the classes used in my blade files are not available:
warn - The `content` option in your Tailwind CSS configuration is missing or empty.
warn - Configure your content sources or your generated CSS will be missing styles.
warn - https://tailwindcss.com/docs/content-configuration
warn - The `content` option in your Tailwind CSS configuration is missing or empty.
warn - Configure your content sources or your generated CSS will be missing styles.
warn - https://tailwindcss.com/docs/content-configuration
resources/css/filament/admin/theme.css
@import '../../../../vendor/filament/filament/resources/css/theme.css';
@config './tailwind.config.js';
@import '../../../../vendor/filament/filament/resources/css/theme.css';
@config './tailwind.config.js';
resources/css/filament/admin/tailwind.config.js
import preset from '../../../../vendor/filament/filament/tailwind.config.preset'

export default {
presets: [preset],
content: [
'./app/Filament/**/*.php',
'./resources/views/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
}
import preset from '../../../../vendor/filament/filament/tailwind.config.preset'

export default {
presets: [preset],
content: [
'./app/Filament/**/*.php',
'./resources/views/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
}
vite.config.js
import { defineConfig } from 'vite';
import laravel 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: true,
}),
],
});
import { defineConfig } from 'vite';
import laravel 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: true,
}),
],
});
If I add a tailwind.config.js in the project root and add some content entries there, the warning disappears, but still the css classes are missing. If I add a syntax error to the resources/css/filament/admin/tailwind.config.js the build process fails, so it appears to read it. Can someone help me?
45 replies
FFilament
Created by friese on 10/11/2023 in #❓┊help
Integrating state-machine with Filament
Right now I'm trying to integrate winzou/state-machine using the laravel service provider sebdesign/laravel-state-machine. I want to be able to view the current state as a badge and execute available transitions in the table view with buttons or a select box. So far I what I've done is the following: - created a new Column (extends from TextColumn and adds features from SelectColumn) - added a public function in the ListRecords class which handles the transition change - added a new column template which is kind of a merge between the text-column and the select-column It all kind of works so far, but it seems unnecessary complicated. Is there an easier way to implement this? Is there an easy way to add a button or a button group to the column template which then triggers the default Table actions? So far I only found how to add buttons to the start/end of a row. Any help or pointers in the right direction are very welcome. As this is my first project with Filament, it could be that I misuse something or don't understand some of the core concepts. My apologies for that 😉
6 replies