pocket.racer
pocket.racer
FFilament
Created by ℬℴ𝒿𝒿𝒾 on 9/17/2023 in #❓┊help
Checkbox List Default
thank you
16 replies
FFilament
Created by ℬℴ𝒿𝒿𝒾 on 9/17/2023 in #❓┊help
Checkbox List Default
looks like i solved it by not using ->default() on the create page, time to sleep
16 replies
FFilament
Created by ℬℴ𝒿𝒿𝒾 on 9/17/2023 in #❓┊help
Checkbox List Default
panel builder create resource page
16 replies
FFilament
Created by ℬℴ𝒿𝒿𝒾 on 9/17/2023 in #❓┊help
Checkbox List Default
My code is something like this
Select::make('checklist_template_id')
->label('Checklist Template')
->live()
->visible(fn (Get $get) => $get('model_id') !== null)
->relationship('checklistTemplate', 'name'),

CheckboxList::make('results')
->live()
->options(function (Get $get): array {

$checklistTemplateId = $get('checklist_template_id');

$checklistTemplate = ChecklistTemplate::find($checklistTemplateId);

if (! $checklistTemplate) {
return [];
}

if ($checklistTemplate->checklist_class) {
$checklistClass = ChecklistManager::getChecklistClass($checklistTemplate->checklist_class);

$checklistObject = new $checklistClass(Order::find($get('model_id')));

return $checklistObject->getKeys();
}

return $checklistTemplate->checklist_keys;
})
->default(function (Get $get) {
ray('checklist-default-called');
$checklistTemplateId = $get('checklist_template_id');

$checklistTemplate = ChecklistTemplate::find($checklistTemplateId);

if (! $checklistTemplate) {
return [];
}

if ($checklistTemplate->checklist_class) {
$checklistClass = ChecklistManager::getChecklistClass($checklistTemplate->checklist_class);

$checklistObject = new $checklistClass(Order::find($get('model_id')));

$result = $checklistObject->getKeysThatAreTrueFromAutoChecks();

return $result;

}

return [];
})
->visible(fn (Get $get): bool => $get('checklist_template_id') !== null)
->bulkToggleable(),
Select::make('checklist_template_id')
->label('Checklist Template')
->live()
->visible(fn (Get $get) => $get('model_id') !== null)
->relationship('checklistTemplate', 'name'),

CheckboxList::make('results')
->live()
->options(function (Get $get): array {

$checklistTemplateId = $get('checklist_template_id');

$checklistTemplate = ChecklistTemplate::find($checklistTemplateId);

if (! $checklistTemplate) {
return [];
}

if ($checklistTemplate->checklist_class) {
$checklistClass = ChecklistManager::getChecklistClass($checklistTemplate->checklist_class);

$checklistObject = new $checklistClass(Order::find($get('model_id')));

return $checklistObject->getKeys();
}

return $checklistTemplate->checklist_keys;
})
->default(function (Get $get) {
ray('checklist-default-called');
$checklistTemplateId = $get('checklist_template_id');

$checklistTemplate = ChecklistTemplate::find($checklistTemplateId);

if (! $checklistTemplate) {
return [];
}

if ($checklistTemplate->checklist_class) {
$checklistClass = ChecklistManager::getChecklistClass($checklistTemplate->checklist_class);

$checklistObject = new $checklistClass(Order::find($get('model_id')));

$result = $checklistObject->getKeysThatAreTrueFromAutoChecks();

return $result;

}

return [];
})
->visible(fn (Get $get): bool => $get('checklist_template_id') !== null)
->bulkToggleable(),
16 replies
FFilament
Created by ℬℴ𝒿𝒿𝒾 on 9/17/2023 in #❓┊help
Checkbox List Default
->default() did not get applied when I'm creating too for Checkboxlist
16 replies
FFilament
Created by pocket.racer on 9/6/2024 in #❓┊help
How to hide placeholder of file upload field?
is it the ->meta() method?
12 replies
FFilament
Created by pocket.racer on 9/6/2024 in #❓┊help
How to hide placeholder of file upload field?
false is not possible, in filament code it only accept null, closure or string
public function placeholder(string | Closure | null $placeholder): static
{
$this->placeholder = $placeholder;

return $this;
}
public function placeholder(string | Closure | null $placeholder): static
{
$this->placeholder = $placeholder;

return $this;
}
I tried all 3, doesn't remove that big white rectangle box
12 replies
FFilament
Created by pocket.racer on 9/6/2024 in #❓┊help
How to hide placeholder of file upload field?
->placeholder('') tried before, still got that big white rectangle on top ->placeholder(false) i haven't try
12 replies
FFilament
Created by pocket.racer on 9/6/2024 in #❓┊help
How to hide placeholder of file upload field?
even if i don't call ->placeholder() it still appear with some default text
12 replies
FFilament
Created by pocket.racer on 9/6/2024 in #❓┊help
How to hide placeholder of file upload field?
the placeholder is just above the black rectangle, that big white rectangle
12 replies
FFilament
Created by Skjena on 10/3/2023 in #❓┊help
Typed property Filament\Widgets\TableWidget::$table must not be accessed before initialization.
same problem too, sometimes happen when switching the select choice in a dashboard filter or when the dashboard page with form filters load
7 replies
FFilament
Created by pocket.racer on 8/29/2024 in #❓┊help
How to do a ranking column in filament table that doesn't change?
thank you
6 replies
FFilament
Created by pocket.racer on 2/28/2024 in #❓┊help
How to stop the navigation sidebar from appearing right after login on mobile?
which file to edit? also i think Marc should get the credit
17 replies
FFilament
Created by pocket.racer on 2/28/2024 in #❓┊help
How to stop the navigation sidebar from appearing right after login on mobile?
if mean if the sidebar is auto closed on mobile when the page loads.
17 replies
FFilament
Created by pocket.racer on 2/28/2024 in #❓┊help
How to stop the navigation sidebar from appearing right after login on mobile?
if this fix could land in core that would be great
17 replies
FFilament
Created by pocket.racer on 2/28/2024 in #❓┊help
How to stop the navigation sidebar from appearing right after login on mobile?
okay so the fix is as follow
FilamentAsset::register([
Js::make('whatever-id', 'the-path-is-absolutely-required-otherwise-error')->html('<script>const win=window,doc=document,docElem=doc.documentElement,body=doc.getElementsByTagName("body")[0],x=win.innerWidth||docElem.clientWidth||body.clientWidth;x<1024&&localStorage.setItem("isOpen","false");</script>')
]);
FilamentAsset::register([
Js::make('whatever-id', 'the-path-is-absolutely-required-otherwise-error')->html('<script>const win=window,doc=document,docElem=doc.documentElement,body=doc.getElementsByTagName("body")[0],x=win.innerWidth||docElem.clientWidth||body.clientWidth;x<1024&&localStorage.setItem("isOpen","false");</script>')
]);
The 2nd argument in make() is required, null or empty string will have error. when u composer update or install (during deploying). So just create an empty js file. then the script code in html(), if u put in the js file it will not work, so u will put that code inside ->html()
17 replies
FFilament
Created by pocket.racer on 2/28/2024 in #❓┊help
How to stop the navigation sidebar from appearing right after login on mobile?
guess i have to put what is in the ->html() into a file and reference that as the 2nd argument in ::make()
17 replies
FFilament
Created by pocket.racer on 2/28/2024 in #❓┊help
How to stop the navigation sidebar from appearing right after login on mobile?
hi, it seem to work but whenever i composer update or deploy to my staging/production i get this error
Filament\Support\Assets\Asset::getPath(): Return value must be of type string, null returned

at vendor/filament/support/src/Assets/Asset.php:55
51▕ }
52▕
53▕ public function getPath(): string
54▕ {
55▕ return $this->path;
56▕ }
57▕
58▕ public function isRemote(): bool
59▕ {

+25 vendor frames
Filament\Support\Assets\Asset::getPath(): Return value must be of type string, null returned

at vendor/filament/support/src/Assets/Asset.php:55
51▕ }
52▕
53▕ public function getPath(): string
54▕ {
55▕ return $this->path;
56▕ }
57▕
58▕ public function isRemote(): bool
59▕ {

+25 vendor frames
U know what caused it?
17 replies
FFilament
Created by pocket.racer on 2/28/2024 in #❓┊help
How to stop the navigation sidebar from appearing right after login on mobile?
may i ask what should be in same-id ? thank you
17 replies
FFilament
Created by pocket.racer on 2/28/2024 in #❓┊help
How to stop the navigation sidebar from appearing right after login on mobile?
may i ask what same-id should be?
17 replies