galli.roberto
galli.roberto
FFilament
Created by Nobody on 12/16/2024 in #❓┊help
Is It Possible to Use a Single Login URL for All Roles in Filament Shield?
Set redirect intended on login success to the panel url Or Override response login
28 replies
FFilament
Created by Jon on 12/14/2024 in #❓┊help
How do i ignore saving of empty repeater relationship fields.
If no row, disable it, or dehydrated false
12 replies
FFilament
Created by galli.roberto on 12/21/2024 in #❓┊help
How to translate slug
it's too hard translate the whole uri. i keep it in english
7 replies
FFilament
Created by galli.roberto on 12/21/2024 in #❓┊help
How to translate slug
I found the solution to have all slug route translated In Resource
public static function routes(Panel $panel): void
{
$originalLocale = app()->getLocale();
foreach(config('app.locales') as $locale) { // <----- AVAILABLE LOCALE IN YOU APP
app()->setLocale($locale);
Route::name(static::getRelativeRouteName() . '.')
->prefix(static::getRoutePrefix())
->middleware(static::getRouteMiddleware($panel))
->withoutMiddleware(static::getWithoutRouteMiddleware($panel))
->group(function () use ($panel) {
foreach (static::getPages() as $name => $page) {
$page->registerRoute($panel)?->name($name);
}
});
}

app()->setLocale($originalLocale);
}
public static function routes(Panel $panel): void
{
$originalLocale = app()->getLocale();
foreach(config('app.locales') as $locale) { // <----- AVAILABLE LOCALE IN YOU APP
app()->setLocale($locale);
Route::name(static::getRelativeRouteName() . '.')
->prefix(static::getRoutePrefix())
->middleware(static::getRouteMiddleware($panel))
->withoutMiddleware(static::getWithoutRouteMiddleware($panel))
->group(function () use ($panel) {
foreach (static::getPages() as $name => $page) {
$page->registerRoute($panel)?->name($name);
}
});
}

app()->setLocale($originalLocale);
}
but at the moment I still haven't figured out how to translate panel path, panel loginRouteSlug, ...
7 replies
FFilament
Created by galli.roberto on 12/21/2024 in #❓┊help
How to translate slug
is called before middleware I cant change locale. The solution is session. In login set session(['locale', '']) and in a boot method of provider use App::setLocale(session()->get('locale')) the code has to be improved. I only check that in login filament doesn't register router, it can be work
7 replies
FFilament
Created by galli.roberto on 12/19/2024 in #❓┊help
Repeater DeleteAction
I do mine follow that. Do you try the things before write? That solution disable action
7 replies
FFilament
Created by galli.roberto on 12/19/2024 in #❓┊help
Repeater DeleteAction
How could I use it? Deletable is global for all whole repeater...
7 replies
FFilament
Created by galli.roberto on 12/20/2024 in #❓┊help
Action Modal - inside user menu
What is different from mine? Button modal doesn't work. Button link yes. I have tried many approaches. The unique that work is modal core concept https://filamentphp.com/docs/3.x/support/blade-components/modal
7 replies
FFilament
Created by galli.roberto on 12/20/2024 in #❓┊help
Action Modal - inside user menu
Did you try it?
7 replies
FFilament
Created by galli.roberto on 12/19/2024 in #❓┊help
Back button
The unique way that I have found to use back button with SPA is use url instead alpineClickHandler and js history
$url = $this->previousUrl ?? static::getResource()::getUrl();

class BackAction
{
public static function make(string $url): Action
{
return Action::make('back')
->icon('heroicon-o-arrow-left')
->hiddenLabel()
->url($url)
->color('gray');
}
}
$url = $this->previousUrl ?? static::getResource()::getUrl();

class BackAction
{
public static function make(string $url): Action
{
return Action::make('back')
->icon('heroicon-o-arrow-left')
->hiddenLabel()
->url($url)
->color('gray');
}
}
4 replies
FFilament
Created by galli.roberto on 12/16/2024 in #❓┊help
Repeater
I used in a wrong way. I used two fields conditionally based on other field to save is_global value, because disabled don't save a value. I mean, I need a toggle button readonly, but ->disabled() make hydratate false, so I fix setting ->diasbled()->dehydratate(true)
Components\Toggle::make('is_global')
->default(UserType::from($get('type'))->isPlaceOwner())
->disabled(UserType::from($get('type'))->isPlaceOwner())
->dehydrated(true) // <----------
Components\Toggle::make('is_global')
->default(UserType::from($get('type'))->isPlaceOwner())
->disabled(UserType::from($get('type'))->isPlaceOwner())
->dehydrated(true) // <----------
13 replies
FFilament
Created by galli.roberto on 12/16/2024 in #❓┊help
Repeater
It happen only on: - visible - hidden
13 replies
FFilament
Created by galli.roberto on 12/16/2024 in #❓┊help
Repeater
yes, i have tried also in filament-demo just now. It happen on visible, i didn't have tried on others property Later I try on other property and make a mini-report
13 replies
FFilament
Created by galli.roberto on 12/16/2024 in #❓┊help
Repeater
Too many call for each item, every item add, the item evaluation increase exponentially this is for 3 item add. Sth wrong happen or is it a normal behaviour? If it is the normal behaviour, why? What is the purpose? It happens for visible, I didn't have tried with ohers property
13 replies
FFilament
Created by galli.roberto on 12/16/2024 in #❓┊help
Repeater
No description
13 replies
FFilament
Created by galli.roberto on 12/16/2024 in #❓┊help
Repeater
Is a normal field inside a schema, later I post a code
13 replies
FFilament
Created by galli.roberto on 12/10/2024 in #❓┊help
Repeater - strange behaviour
I changes the way I use it, I don't have the code now, sorry
6 replies
FFilament
Created by Dimitar Papazov DEV on 12/1/2024 in #❓┊help
Repeater and many-to-many (belognsToMany, morphsToMany) not saving
I did it save to morphmany
7 replies
FFilament
Created by galli.roberto on 12/10/2024 in #❓┊help
Repeater - strange behaviour
no, it's regular form
6 replies
FFilament
Created by Dimitar Papazov DEV on 12/1/2024 in #❓┊help
Repeater and many-to-many (belognsToMany, morphsToMany) not saving
You have to save pivot table HasMany. Create a relation hasMany to Pivot on your model. You could also do it nested I think it is written on docs.
7 replies