Čamap
Čamap
FFilament
Created by Čamap on 9/22/2023 in #❓┊help
Use colors setup from certain panel in external livewire layout/component
When using colors builder method such as:
public function panel(Panel $panel): Panel
{
return $panel
->default()
->id('app')
->path('v2')
->login()
->colors([
'danger' => Color::Rose,
'primary' => Color::Teal,
'secondary' => Color::Gray,
'success' => Color::Green,
'warning' => Color::Yellow,
])
...
..
.
public function panel(Panel $panel): Panel
{
return $panel
->default()
->id('app')
->path('v2')
->login()
->colors([
'danger' => Color::Rose,
'primary' => Color::Teal,
'secondary' => Color::Gray,
'success' => Color::Green,
'warning' => Color::Yellow,
])
...
..
.
How do I import this color setup into an external layout used outside of filament? Is there maybe a method familiar to
{{ filament()->getTheme()->getHtml() }}
{{ filament()->getTheme()->getHtml() }}
, but for colors instead ?
5 replies
FFilament
Created by Čamap on 9/5/2023 in #❓┊help
Tailwind classes still missing in filament-page's custom view
Hi, when adding a filament-page with custom view in /resources/views/filament/admin/pages/custom-page.blade.php, shouldnt tailwind with this config make sure to include classes that are used in the view blade (because of ./resources/views/**/*.blade.php rule?
import preset from './vendor/filament/support/tailwind.config.preset'

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

export default {
presets: [preset],
content: [
'./app/Filament/**/*.php',
'./resources/views/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
}
Because this doesnt seem to work, I'm still missing the classes and only have filament's builtins available..
49 replies
FFilament
Created by Čamap on 9/3/2023 in #❓┊help
Unable to load proper styles for components used outside of admin panel
I've got a basic layout blade and I want to use button from filament. No luck so far, I've read the docs but sadly did not find anything or missed it.. app.blade.php
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link type="stylesheet" href="public/css/filament/support/support.css"> <!-- Filament support styles -->
@vite(['resources/css/app.css', 'resources/js/app.js'])

<title>Test page</title>
</head>
<body>
<x-filament::button>
Button
</x-filament::button>
</body>
</html>
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link type="stylesheet" href="public/css/filament/support/support.css"> <!-- Filament support styles -->
@vite(['resources/css/app.css', 'resources/js/app.js'])

<title>Test page</title>
</head>
<body>
<x-filament::button>
Button
</x-filament::button>
</body>
</html>
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'],
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'],
refresh: true,
}),
],
});
and tailwind.config.js
/** @type {import('tailwindcss').Config} */
export default {
content: [
"./resources/**/*.blade.php",
"./resources/**/*.js",
],
theme: {
extend: {},
},
plugins: [],
}
/** @type {import('tailwindcss').Config} */
export default {
content: [
"./resources/**/*.blade.php",
"./resources/**/*.js",
],
theme: {
extend: {},
},
plugins: [],
}
Am I missing something? It is probably something stupid I forgot about.. the styles actually get loaded but the button is not styled properly.. one thing I noticed is that --c-400: var(--primary-400); --c-500: var(--primary-500); --c-600: var(--primary-600); on the button dont work, it says that --primary-400, --primary-500, --primary-600 are not defined.
9 replies
FFilament
Created by Čamap on 8/24/2023 in #❓┊help
Assert visibility of every field of Tab in resource form
Is there a way to assert that entire Tab with fields in form is visible/hidden? I've got a form with this schema
public static function form(Form $form): Form
{
return $form
->schema([
Tabs::make('tabs')->schema([
Tab::make(__('Internal services'))
->visible(true) // dummy condition
->schema(self::internalFields()),

Tab::make(__('External services'))
->visible(false) // dummy condition
->schema(self::externalFields()),

.....
public static function form(Form $form): Form
{
return $form
->schema([
Tabs::make('tabs')->schema([
Tab::make(__('Internal services'))
->visible(true) // dummy condition
->schema(self::internalFields()),

Tab::make(__('External services'))
->visible(false) // dummy condition
->schema(self::externalFields()),

.....
I want to assert that all fields in Internal services tab are visible and assert that all fields in External services tab are hidden. I'm currently asserting visibility of each field, which seems a bit excessive, since every tab has like 15 fields..
6 replies
FFilament
Created by Čamap on 7/14/2023 in #❓┊help
Translatable Relation manager
Hi, I'm using spatie translatable plugin for translating models and resources. I need to make it work in Relation Managers. Since the package does not support it right away, I found a possible fix https://github.com/filamentphp/filament/discussions/1514#discussioncomment-2156698 but the solution does not seem to work - I'm getting the same exact issue as https://github.com/filamentphp/filament/discussions/1514#discussioncomment-3099334 Is there a possible workaround or is it just not possible to make it work with rm?
2 replies
FFilament
Created by Čamap on 5/16/2023 in #❓┊help
Is there a way to add custom actions to header of a form builder block?
4 replies