jeph
jeph
FFilament
Created by jeph on 2/9/2024 in #❓┊help
two columns from a single database column
sorry ->id( ) did not work Method Filament\Tables\Columns\TextColumn::id does not exist.
6 replies
FFilament
Created by jeph on 2/9/2024 in #❓┊help
two columns from a single database column
i see.. yeah i think that would work as well. i will go that route if there's no way to do it anymore using only filament. before in v2 its as simple as creating two TextColumn::make('name') with different labels.
6 replies
FFilament
Created by Gustave on 12/1/2023 in #❓┊help
Form validation in Livewire component
We have the same problem. Yours will probably work by adding ->validate() before you use the form data. Ex.
public function submit(): void
{
$this->form->validate();
.....
}
public function submit(): void
{
$this->form->validate();
.....
}
But mine wont work. The problem with my code is that i combine form and table in one component.. $this->form->validate() Just didn't work. It probably have conflict variable with $form.
3 replies
FFilament
Created by jeph on 12/18/2023 in #❓┊help
Validation didn't work
Thank you so much for your time @Ngannv ! I really can't make that code work. Maybe there's something wrong with my code formatting. Is it okey to combine form and table in one component? maybe this is the one causing the problem. Here's the simplified version of my code: https://vhelper.pro/share/pGX641H2L
9 replies
FFilament
Created by jeph on 12/18/2023 in #❓┊help
Validation didn't work
Hello @Ngannv ! Maybe you have some idea.
public function submit(): void
{
$this->form->validate();

$query = Domain::query();
...

return $query;
}
public function submit(): void
{
$this->form->validate();

$query = Domain::query();
...

return $query;
}
is not working. while
public function submit(): void
{
$this->validate();

$query = Domain::query();
...

return $query;
}
public function submit(): void
{
$this->validate();

$query = Domain::query();
...

return $query;
}
validation works with error message when the condition is false (max is less than min). but if the condition true (max is greater than min), it would throw an error: Typed property App\Livewire\Domaintable::$table must not be accessed before initialization
9 replies
FFilament
Created by jeph on 12/18/2023 in #❓┊help
Validation didn't work
but the way, the form here is not used to save something to the server. i just used it to make a bit of complex query to the table.
9 replies
FFilament
Created by jeph on 12/18/2023 in #❓┊help
Validation didn't work
thanks a lot for the response @Ngannv ! My code is formatted like this:
public function form(Form $form): Form
{
return $form

->schema([
TextInput::make('min')
->numeric()
->live(),
TextInput::make('max')
->numeric()
->gt('min')
->live(),
]);
}

public function submit()
{
$query = Domain::query();
...

return $query;
}


public function table(Table $table): Table
{
return $table
->query($this->submit())
->columns([
...
]);
}

public function form(Form $form): Form
{
return $form

->schema([
TextInput::make('min')
->numeric()
->live(),
TextInput::make('max')
->numeric()
->gt('min')
->live(),
]);
}

public function submit()
{
$query = Domain::query();
...

return $query;
}


public function table(Table $table): Table
{
return $table
->query($this->submit())
->columns([
...
]);
}

Can you suggest where should I put the ->validate()? it would make error when I put
return $form->validate()
return $form->validate()
or
->schema([
TextInput::make('min')
->numeric()
->live(),
TextInput::make('max')
->numeric()
->gt('min')
->live(),
])->validate();
->schema([
TextInput::make('min')
->numeric()
->live(),
TextInput::make('max')
->numeric()
->gt('min')
->live(),
])->validate();
as well as
return $query->validate();
return $query->validate();
9 replies
FFilament
Created by carlosrgzm on 8/19/2023 in #❓┊help
How to limit the results displayed on a table for tables with more than 1M records
I have almost a million records though so i cannot disable pagination or else it would crash showing almost a million records at once. What i did was to just to add query->where("id", "<", 800000). Works for me. Its just that >800000 wont be included in the results.
13 replies
FFilament
Created by carlosrgzm on 8/19/2023 in #❓┊help
How to limit the results displayed on a table for tables with more than 1M records
Yeah. You just need to disable pagination and your limit() will work. Laravel pagination feature overrides limit(). So when you disable pagination, it will work already.
13 replies
FFilament
Created by carlosrgzm on 8/19/2023 in #❓┊help
How to limit the results displayed on a table for tables with more than 1M records
hi there guys! I also need to limit table results. please guide me how to do it. $query->limit(100)->get() won't work.
13 replies
FFilament
Created by jeph on 9/27/2023 in #❓┊help
Blur the rest of the query result except the first 5
No description
20 replies
FFilament
Created by jeph on 9/27/2023 in #❓┊help
Blur the rest of the query result except the first 5
It is working but instead, i want to modify the class of the first 5 result.
20 replies
FFilament
Created by jeph on 9/27/2023 in #❓┊help
Blur the rest of the query result except the first 5
No description
20 replies
FFilament
Created by jeph on 9/27/2023 in #❓┊help
Blur the rest of the query result except the first 5
I mean the key of the records. Can you please provide a sample code targeting only the first 5 records of like 20 total records from the query?
20 replies
FFilament
Created by jeph on 9/27/2023 in #❓┊help
Blur the rest of the query result except the first 5
No description
20 replies
FFilament
Created by jeph on 9/27/2023 in #❓┊help
Blur the rest of the query result except the first 5
If only i know how to get the value of the query result key, i might be able to accomplish it. I want to copy this feature from other websites that the rest of the result are shown but blur.
20 replies
FFilament
Created by jeph on 9/18/2023 in #❓┊help
Multiple Select and hint wont work on production
i was able to resolve it in mobile by using tailwind and alpinejs cdn. i wonder why it cannot fetch the js and css build.
11 replies