Marc
Marc
FFilament
Created by Marc on 6/3/2024 in #❓┊help
how to display badges inline on infoview
with ->columnSpanFull() the same thing happens
8 replies
FFilament
Created by Marc on 6/3/2024 in #❓┊help
how to display badges inline on infoview
What I have found is using CSS but I don't know if there is another way to do it
.fi-in-entry-wrp .fi-in-text .fi-in-affixes .flex.w-max{
width: auto !important;
}
.fi-in-entry-wrp .fi-in-text .fi-in-affixes .flex.w-max{
width: auto !important;
}
8 replies
FFilament
Created by Marc on 6/3/2024 in #❓┊help
how to display badges inline on infoview
No description
8 replies
FFilament
Created by Marc on 6/3/2024 in #❓┊help
how to display badges inline on infoview
No description
8 replies
FFilament
Created by Marc on 6/3/2024 in #❓┊help
how to display badges inline on infoview
No description
8 replies
FFilament
Created by Marc on 5/31/2024 in #❓┊help
Refresh the form after saving in SPA mode
The ->refreshFormData() is only for the update page, I don't know what your code does, but try: https://filamentphp.com/docs/3.x/infolists/actions#adding-a-hint-action-to-an-entry
10 replies
FFilament
Created by Marc on 5/31/2024 in #❓┊help
Refresh the form after saving in SPA mode
In the video it uses debounce and onBlur but I have found some errors and in this case I do not like to use it, the errors are the following: - debounce: If you put a big debounce, when you are in the field and hit save, if the debounce has not been updated, the previous value is stored, but if you put a small value, it is very difficult to write it, because of slug() , eliminating spaces and all that. - onBlur: If they are in the field and you click save, it doesn't save, you have to click save 2 times to be able to save or click outside the field and then click save. In both cases, it gives a bad experience to the user, does not queue or something to avoid this, for example: - debounce: if you click save, execute debounce first and then save, instead of just saving. - onBlur: if you click save, run onBlur and then save, instead of just running onBlur without saving.
10 replies
FFilament
Created by Marc on 5/31/2024 in #❓┊help
Refresh the form after saving in SPA mode
The problem is the same, with or without the spa mode and the solution is also the same, with $this->refreshFormData(['slug']); it does nothing but with $this->fillForm(); reloads the field (and all form)
10 replies
FFilament
Created by Marc on 5/31/2024 in #❓┊help
Refresh the form after saving in SPA mode
This doesn't work for me
protected function afterSave(): void
{
$this->refreshFormData(['slug']);
}
protected function afterSave(): void
{
$this->refreshFormData(['slug']);
}
But after investigating, this does work for me.
protected function afterSave(): void
{
$this->fillForm();
}
protected function afterSave(): void
{
$this->fillForm();
}
10 replies
FFilament
Created by Marc on 5/30/2024 in #❓┊help
How to make a rule "in" of a multiple select
I think the filament doesn't have support for this case, I also tried with
->validationAttribute('middlewares.*')
->validationAttribute('middlewares.*')
but it doesn't work
13 replies
FFilament
Created by Marc on 5/30/2024 in #❓┊help
How to make a rule "in" of a multiple select
->rule(fn (Select $component) => function (string $attribute, $value, Closure $fail) use($component){
$in = ['web', 'auth', 'guest', 'signed'];
foreach ($value as $tmp) {
if (!in_array($tmp, $in)) {
$fail(__('validation.in', ['attribute' => $component->getLabel()]));
}
}
})
->rule(fn (Select $component) => function (string $attribute, $value, Closure $fail) use($component){
$in = ['web', 'auth', 'guest', 'signed'];
foreach ($value as $tmp) {
if (!in_array($tmp, $in)) {
$fail(__('validation.in', ['attribute' => $component->getLabel()]));
}
}
})
13 replies
FFilament
Created by Marc on 5/30/2024 in #❓┊help
How to make a rule "in" of a multiple select
In Laravel, if it is a validation of an array, the field.* is used, but if filament does not support this, I will have to do a manual validation
13 replies
FFilament
Created by Marc on 5/30/2024 in #❓┊help
How to make a rule "in" of a multiple select
It works if the multiple is removed, but when adding the multiple it gives me that error
13 replies
FFilament
Created by Marc on 5/30/2024 in #❓┊help
How to make a rule "in" of a multiple select
->in(['web', 'auth', 'guest', 'signed'])
->in(['web', 'auth', 'guest', 'signed'])
13 replies
FFilament
Created by Marc on 5/30/2024 in #❓┊help
How to make a rule "in" of a multiple select
No description
13 replies
FFilament
Created by Marc on 5/30/2024 in #❓┊help
How to make a rule "in" of a multiple select
same problem
13 replies
FFilament
Created by Marc on 5/14/2024 in #❓┊help
Unable to find component for relationship manager
class FutbolbasePanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->id('futbol')
->path('futbol')
->colors([
'primary' => Color::Amber,
])
->discoverResources(in: app_path('Filament/Futbol/Resources'), for: 'App\\Filament\\Futbol\\Resources')
->discoverPages(in: app_path('Filament/Futbol/Pages'), for: 'App\\Filament\\Futbol\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/Futbol/Widgets'), for: 'App\\Filament\\Futbol\\Widgets')
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
]);
}
}
class FutbolbasePanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->id('futbol')
->path('futbol')
->colors([
'primary' => Color::Amber,
])
->discoverResources(in: app_path('Filament/Futbol/Resources'), for: 'App\\Filament\\Futbol\\Resources')
->discoverPages(in: app_path('Filament/Futbol/Pages'), for: 'App\\Filament\\Futbol\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/Futbol/Widgets'), for: 'App\\Filament\\Futbol\\Widgets')
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
]);
}
}
6 replies
FFilament
Created by PabloZagni on 3/19/2024 in #❓┊help
How to combine multiple fields into one? Address field
8 replies
FFilament
Created by rullyka on 2/28/2024 in #❓┊help
How to change ->Login() to Another URL
For that, instead of creating a custom login, I would recommend that you create a middleware.
18 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?
Also encountered the same problem, an alternative, which I think would work better, is to add this:
FilamentView::registerRenderHook(
PanelsRenderHook::BODY_START,
fn (): string => '<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>',
);
FilamentView::registerRenderHook(
PanelsRenderHook::BODY_START,
fn (): string => '<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>',
);
https://filamentphp.com/docs/3.x/support/render-hooks
17 replies