ico
ico
FFilament
Created by ico on 6/27/2024 in #❓┊help
Filament v2 Form Builder Disable inner repeater
So in the Toggle afterStateUpddated i modify the $disableReturnQuantityRepeater property and in the Repeater disableItemCreation method i disable the current repeater based on the data inside the $disableReturnQuantityRepeater with is with a structure repeater index => true/false
4 replies
FFilament
Created by ico on 6/27/2024 in #❓┊help
Filament v2 Form Builder Disable inner repeater
Ok i just had a realization I can make it like this.
public $disableReturnQuantityRepeater = [];

.
.
.

// toggle
->afterStateUpdated(function (Toggle $component, $state) {

$repeaterIndex = $this->getPathIndex($component);

if ($state) {

$this->returnGoods[$repeaterIndex]['returnQuantities'] = [];
$this->disableReturnQuantityRepeater[$repeaterIndex] = true;

return;
}

$this->disableReturnQuantityRepeater[$repeaterIndex] = false;
}),
.
.
.

// repeater
->disableItemCreation(function (Repeater $component) {

$repeaterIndex = $this->getPathIndex($component);

if (array_key_exists($repeaterIndex, $this->disableReturnQuantityRepeater))
return $this->disableReturnQuantityRepeater[$repeaterIndex];
})

.
.
.
.

protected function getPathIndex(mixed $component): int|string
{
// this will return something like 'returnGoods.0.returnGoodsCheckbox'
$componentPath = $component->getStatePath();
$componentPathExploded = explode('.', $componentPath);

return $componentPathExploded[1];
}
public $disableReturnQuantityRepeater = [];

.
.
.

// toggle
->afterStateUpdated(function (Toggle $component, $state) {

$repeaterIndex = $this->getPathIndex($component);

if ($state) {

$this->returnGoods[$repeaterIndex]['returnQuantities'] = [];
$this->disableReturnQuantityRepeater[$repeaterIndex] = true;

return;
}

$this->disableReturnQuantityRepeater[$repeaterIndex] = false;
}),
.
.
.

// repeater
->disableItemCreation(function (Repeater $component) {

$repeaterIndex = $this->getPathIndex($component);

if (array_key_exists($repeaterIndex, $this->disableReturnQuantityRepeater))
return $this->disableReturnQuantityRepeater[$repeaterIndex];
})

.
.
.
.

protected function getPathIndex(mixed $component): int|string
{
// this will return something like 'returnGoods.0.returnGoodsCheckbox'
$componentPath = $component->getStatePath();
$componentPathExploded = explode('.', $componentPath);

return $componentPathExploded[1];
}
4 replies
FFilament
Created by ico on 4/12/2024 in #❓┊help
Filament v2 Wizard Step mandatory
for the form builder...since i have used it in the table builder
14 replies
FFilament
Created by ico on 4/12/2024 in #❓┊help
Filament v2 Wizard Step mandatory
Does filament 2 have that also ?
14 replies
FFilament
Created by ico on 4/12/2024 in #❓┊help
Filament v2 Wizard Step mandatory
both are valid
14 replies
FFilament
Created by ico on 4/12/2024 in #❓┊help
Filament v2 Wizard Step mandatory
Till now if i have a required field in one of the steps it doesn;t skip it but on this step the user may or not fill a input
14 replies
FFilament
Created by ico on 4/12/2024 in #❓┊help
Filament v2 Wizard Step mandatory
how can i do that ?
14 replies
FFilament
Created by ico on 3/22/2024 in #❓┊help
Filament v2 Form Builder: How to add button in Repeater ?
Is there a better way ?
5 replies
FFilament
Created by ico on 3/22/2024 in #❓┊help
Filament v2 Form Builder: How to add button in Repeater ?
But not sure if this is the right path
5 replies
FFilament
Created by ico on 3/22/2024 in #❓┊help
Filament v2 Form Builder: How to add button in Repeater ?
5 replies
FFilament
Created by ico on 3/22/2024 in #❓┊help
Filament v2 Form Builder: How to add button in Repeater ?
What i just found is that i could do a ViewField in witch i have a button. Witch when clicked will dispatch a event. But how do i catch the index of the repeater so i can send it to the ViewField ?
5 replies
FFilament
Created by ico on 11/4/2023 in #❓┊help
Filament v2 property null when searching
To escape this repeating of code i added the hydrate hook in the livewire component This worked very well
public function mount()
{
$this->tableProperty = DataTableInitializer::initialize($this->dataTableType);
$this->dataTableButtons = $this->tableProperty['dataTableButtons'];
}
public function hydrate()
{
// filament table loses its inner properties. So on each hydrate of the livewire component i must provide the initializing of the tableProperty
$this->tableProperty = DataTableInitializer::initialize($this->dataTableType);
$this->dataTableButtons = $this->tableProperty['dataTableButtons'];
}
public function mount()
{
$this->tableProperty = DataTableInitializer::initialize($this->dataTableType);
$this->dataTableButtons = $this->tableProperty['dataTableButtons'];
}
public function hydrate()
{
// filament table loses its inner properties. So on each hydrate of the livewire component i must provide the initializing of the tableProperty
$this->tableProperty = DataTableInitializer::initialize($this->dataTableType);
$this->dataTableButtons = $this->tableProperty['dataTableButtons'];
}
4 replies
FFilament
Created by ico on 10/17/2023 in #❓┊help
Filament v3 not detecting Tailwind classes
The problem is not that it doesn't detect the tailwind classes .....the problem is that tailwind doesn't support bg coloring on a input. From what i see i made it from 'bg-green-200' to text-green-200 and it worked it colored the text
27 replies
FFilament
Created by ico on 10/17/2023 in #❓┊help
Filament v3 not detecting Tailwind classes
the bg-red-500 class is indeed in the public css file
27 replies
FFilament
Created by ico on 10/17/2023 in #❓┊help
Filament v3 not detecting Tailwind classes
will check the public css in a moment
27 replies
FFilament
Created by ico on 10/17/2023 in #❓┊help
Filament v3 not detecting Tailwind classes
yes we had to some point but didn't get it resolve and didn't see my discusion so i made a new one
27 replies
FFilament
Created by ico on 10/17/2023 in #❓┊help
Filament v3 not detecting Tailwind classes
but since these classes are not in a blade file it skips them
27 replies
FFilament
Created by ico on 10/17/2023 in #❓┊help
Filament v3 not detecting Tailwind classes
I think the problem is that vite doesn't render all of the classes of tailwind and just those that i use
27 replies
FFilament
Created by ico on 10/17/2023 in #❓┊help
Filament v3 not detecting Tailwind classes
in my layout i have
@filamentStyles
@livewireStyles

@vite('resources/css/app.css')
</head>

<body x-data="{}" class="w-full h-full font-sans">
@livewireScriptConfig
@filamentScripts
@vite('resources/js/app.js')
@stack('scripts')
</body>
@filamentStyles
@livewireStyles

@vite('resources/css/app.css')
</head>

<body x-data="{}" class="w-full h-full font-sans">
@livewireScriptConfig
@filamentScripts
@vite('resources/js/app.js')
@stack('scripts')
</body>
27 replies
FFilament
Created by ico on 10/17/2023 in #❓┊help
Filament v3 not detecting Tailwind classes
it is applied in the class attribute but it doesn't color it
27 replies