Patie
Patie
Explore posts from servers
FFilament
Created by Patie on 9/8/2024 in #❓┊help
Records count in table header
ok it was my fault, view was blade component, not livewire component, now its working
6 replies
FFilament
Created by Patie on 9/8/2024 in #❓┊help
Records count in table header
meh.. its working with search, but not with filters for some reason 😦
6 replies
FFilament
Created by Patie on 9/8/2024 in #❓┊help
Records count in table header
looks like its working with:
public function updated()
{
$this->total = $this->getFilteredTableQuery()->count();
$this->getTable()->header($this->getTableHeader());
}

public function rendering()
{
$this->total = $this->getFilteredTableQuery()->count();
$this->getTable()->header($this->getTableHeader());
}

protected function getTableHeader(): ?View
{
if ($this->total > 0) {
return view('components.banner', ['message' => $this->total, 'style' => 'warning']);
}
return null;
}
public function updated()
{
$this->total = $this->getFilteredTableQuery()->count();
$this->getTable()->header($this->getTableHeader());
}

public function rendering()
{
$this->total = $this->getFilteredTableQuery()->count();
$this->getTable()->header($this->getTableHeader());
}

protected function getTableHeader(): ?View
{
if ($this->total > 0) {
return view('components.banner', ['message' => $this->total, 'style' => 'warning']);
}
return null;
}
its correct way how to do it?
6 replies
FFilament
Created by Patie on 9/7/2024 in #❓┊help
OpenSearch/ElasticSearch
not sure if its the best way, its looks like my idea working (part of it is same as from documentation @awcodes , but its not documented well), anyway thank you
8 replies
FFilament
Created by Patie on 9/7/2024 in #❓┊help
OpenSearch/ElasticSearch
is there better way? like method where i can do all at once?
8 replies
FFilament
Created by Patie on 9/7/2024 in #❓┊help
OpenSearch/ElasticSearch
possible somehow like with this? applySearchToTableQuery protected function applyFiltersToTableQuery
protected function applyFiltersToTableQuery(Builder $query): Builder
{
$filters = $this->getTable()->getFilters();
// search in elastic and return ids
// $query->whereIn
return $query;
}
protected function applySearchToTableQuery(Builder $query): Builder
{
$search = $this->getTableSearch();
// search in elastic and return ids
// $query->whereIn
return $query;
}
protected function applyFiltersToTableQuery(Builder $query): Builder
{
$filters = $this->getTable()->getFilters();
// search in elastic and return ids
// $query->whereIn
return $query;
}
protected function applySearchToTableQuery(Builder $query): Builder
{
$search = $this->getTableSearch();
// search in elastic and return ids
// $query->whereIn
return $query;
}
8 replies
FFilament
Created by Patie on 4/4/2024 in #❓┊help
Table update after action
it's a pity that there is no way to insert the form from another file like nested component into section section (or into tab directly) and must be used Livewire here
15 replies
FFilament
Created by Patie on 4/4/2024 in #❓┊help
Table update after action
but i understand its more like livewire problem and not filament
15 replies
FFilament
Created by Patie on 4/4/2024 in #❓┊help
Table update after action
hmm is strage dispatch not working from inside of
$this->userDocumentForm->action($data, $user);
$this->userDocumentForm->action($data, $user);
method, but only when its directly fired from action like this:
Section::make('Documents')
->id('documents')
->headerActions([
Action::make('Add document')
->form($this->userDocumentForm->schema())
->action(function (array $data, User $user) {
$this->userDocumentForm->action($data, $user);
$this->dispatch('user-document-created');

})
])
->schema([
Livewire::make(UserDocumentTable::class, ['userId' => $this->user->id])->key('user-document-table'),
]),
Section::make('Documents')
->id('documents')
->headerActions([
Action::make('Add document')
->form($this->userDocumentForm->schema())
->action(function (array $data, User $user) {
$this->userDocumentForm->action($data, $user);
$this->dispatch('user-document-created');

})
])
->schema([
Livewire::make(UserDocumentTable::class, ['userId' => $this->user->id])->key('user-document-table'),
]),
15 replies
FFilament
Created by Patie on 4/4/2024 in #❓┊help
Table update after action
yes, emitting on whole component is working ofc, thx computed property probably should be on documents as table showing documents in rows, user is only for filtering
15 replies
FFilament
Created by Patie on 4/4/2024 in #❓┊help
Table update after action
im using
->schema([
Livewire::make(UserDocumentTable::class, ['userId' => $this->user->id])->key('user-document-table'),
]),
->schema([
Livewire::make(UserDocumentTable::class, ['userId' => $this->user->id])->key('user-document-table'),
]),
because i want reuse existing table code, is there better way how to do it maybe?
15 replies
FFilament
Created by Patie on 4/4/2024 in #❓┊help
Table update after action
probably bcs i have it as Livewire::make 🤔
15 replies
FFilament
Created by Patie on 4/4/2024 in #❓┊help
Table update after action
not automatically re-rendered in my case, probably i have something wrong
15 replies
FFilament
Created by Patie on 4/4/2024 in #❓┊help
Table update after action
refresh whole component is only (correct) way when using standalone components? there is no way to reload only data on filament table or smth like this? thank you @awcodes
15 replies
CDCloudflare Developers
Created by Patie on 11/25/2023 in #workers-help
Confused about caching
thank you
12 replies