Abmael Souza
Abmael Souza
FFilament
Created by NolanN on 1/14/2025 in #❓┊help
Building a complex countdown table column
it would watch changes in the getState and recalculate everything
29 replies
FFilament
Created by NolanN on 1/14/2025 in #❓┊help
Building a complex countdown table column
on the same div as x-data
29 replies
FFilament
Created by NolanN on 1/14/2025 in #❓┊help
Building a complex countdown table column
using x-init you could pass
x-init="$watch('{{ $getState()->toISOString() }}', value => updateValues(new Date(value).getTime()))"
x-init="$watch('{{ $getState()->toISOString() }}', value => updateValues(new Date(value).getTime()))"
29 replies
FFilament
Created by NolanN on 1/14/2025 in #❓┊help
Building a complex countdown table column
i believe the solution could be this https://alpinejs.dev/magics/watch
29 replies
FFilament
Created by guiiz on 1/14/2025 in #❓┊help
How add a query to the table
the presented solutions were of your approval?
33 replies
FFilament
Created by guiiz on 1/14/2025 in #❓┊help
How add a query to the table
its a hidden toggle, i bet its not the best option for it, but it might solve your problem
33 replies
FFilament
Created by guiiz on 1/14/2025 in #❓┊help
How add a query to the table
it would look like this for your code
$form
->schema([
Forms\Components\TextInput::make('name')
->label('Name')
->required()
->placeholder('John Doe'),
Forms\Components\TextInput::make('email')
->label('Email')
->required()
->placeholder('[email protected]'),
Forms\Components\TextInput::make('password')
->label('Password')
->required()
->placeholder('********')
->password()
->autocomplete('new-password'),
Forms\Components\Toggle::make('active')
->label('Ativo')
->default(true),
Forms\Components\Toggle::make('is_admin')
->label('Admin')
->default(false)
->visible(fn (?Model $record) => $record?->id !== Auth::id()),

// Add this component for the is_super condition
Forms\Components\Toggle::make('is_super')
->label('Super User')
->default(false)
->hidden(fn (?Model $record) => $record?->is_super ?? false), // Hides the field for super users
]);
$form
->schema([
Forms\Components\TextInput::make('name')
->label('Name')
->required()
->placeholder('John Doe'),
Forms\Components\TextInput::make('email')
->label('Email')
->required()
->placeholder('[email protected]'),
Forms\Components\TextInput::make('password')
->label('Password')
->required()
->placeholder('********')
->password()
->autocomplete('new-password'),
Forms\Components\Toggle::make('active')
->label('Ativo')
->default(true),
Forms\Components\Toggle::make('is_admin')
->label('Admin')
->default(false)
->visible(fn (?Model $record) => $record?->id !== Auth::id()),

// Add this component for the is_super condition
Forms\Components\Toggle::make('is_super')
->label('Super User')
->default(false)
->hidden(fn (?Model $record) => $record?->is_super ?? false), // Hides the field for super users
]);
33 replies
FFilament
Created by guiiz on 1/14/2025 in #❓┊help
How add a query to the table
->filters([
Tables\Filters\Filter::make('Exclude Super Users')
->query(fn (Builder $query) => $query->where('is_super', false))
->default(), // Applies by default
])
->filters([
Tables\Filters\Filter::make('Exclude Super Users')
->query(fn (Builder $query) => $query->where('is_super', false))
->default(), // Applies by default
])
33 replies
FFilament
Created by guiiz on 1/14/2025 in #❓┊help
How add a query to the table
in your $table variable on table function
33 replies
FFilament
Created by guiiz on 1/14/2025 in #❓┊help
How add a query to the table
I see, if that did not do it, you might be able to add a custom filter
33 replies
FFilament
Created by guiiz on 1/14/2025 in #❓┊help
How add a query to the table
is it really a boolean there?
33 replies
FFilament
Created by guiiz on 1/14/2025 in #❓┊help
How add a query to the table
we might also add translation below for better expression of ideas
33 replies
FFilament
Created by guiiz on 1/14/2025 in #❓┊help
How add a query to the table
given that the group chat is international, we should stick to english so other people could join and help
33 replies
FFilament
Created by guiiz on 1/14/2025 in #❓┊help
How add a query to the table
yes, i'm also from brazil
33 replies
FFilament
Created by guiiz on 1/14/2025 in #❓┊help
How add a query to the table
how's the model setup for users? como tá a model de usuários?
33 replies
FFilament
Created by guiiz on 1/14/2025 in #❓┊help
How add a query to the table
only values
33 replies
FFilament
Created by guiiz on 1/14/2025 in #❓┊help
How add a query to the table
you didin't show the table headers to me
33 replies
FFilament
Created by guiiz on 1/14/2025 in #❓┊help
How add a query to the table
how is your model setup?
33 replies
FFilament
Created by guiiz on 1/14/2025 in #❓┊help
How add a query to the table
you would have to rewrite the "query" function on the same file you are on
public static function query(): Builder
{
// Filter users where is_super is false
return parent::query()->where('is_super', false);
}
public static function query(): Builder
{
// Filter users where is_super is false
return parent::query()->where('is_super', false);
}
33 replies