Prodex
Prodex
FFilament
Created by Prodex on 12/10/2024 in #❓┊help
How to access attributes of a selected record, without duplicate queries?
oh, cool "hack". Worked perfectly.
7 replies
FFilament
Created by Prodex on 12/10/2024 in #❓┊help
How to access attributes of a selected record, without duplicate queries?
do you have an example?
7 replies
FFilament
Created by Prodex on 12/2/2024 in #❓┊help
Overriding paginateTableQuery doesn't work on Widgets
Sorry, let me explain: My Widget extended "TableWidget", which has the following vendor code:
protected function paginateTableQuery(Builder $query): Paginator | CursorPaginator
{
return $query->simplePaginate(
perPage: ($this->getTableRecordsPerPage() === 'all') ? $query->count() : $this->getTableRecordsPerPage(),
pageName: $this->getTablePaginationPageName(),
);
}
protected function paginateTableQuery(Builder $query): Paginator | CursorPaginator
{
return $query->simplePaginate(
perPage: ($this->getTableRecordsPerPage() === 'all') ? $query->count() : $this->getTableRecordsPerPage(),
pageName: $this->getTablePaginationPageName(),
);
}
So using TableWidget the pagination is already set to simple. Which I should be able to overwrite but that didn't work for some reason. Now, since you can also use custom widgets which just extend "Widget" that don't set the pagination to simple, I implemented HasTables and HasForms myself and the cursor pagination appeared as expected. I just don't understand why overwriting the paginateTableQuery method while extending TableWidget didn't do anything. For your last response: just removing "paginateTableQuery" in my Widget would still cause the pagination to be simple, as it is set so in the TableWidget. Did you understand that? 😅
8 replies
FFilament
Created by Prodex on 12/2/2024 in #❓┊help
Overriding paginateTableQuery doesn't work on Widgets
Yes I see, but in that case the paginateTableQuery is set to simple when extending the TableWidget. Changing it to extend "Widget" solves the issue. But I still don't know why the overwrite didn't work, as it normally should.
8 replies
FFilament
Created by Prodex on 12/2/2024 in #❓┊help
Overriding paginateTableQuery doesn't work on Widgets
Hm... I did that now, but it's still a simple Pagination in the Frontend.
use App\Filament\Resources\CompanyResource;
use App\Models\Company;
use Filament\Forms\Components\TextInput;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Concerns\CanPaginateRecords;
use Filament\Tables\Enums\FiltersLayout;
use Filament\Tables\Filters\Filter;
use Filament\Tables\Table;
use Filament\Widgets\TableWidget;
use Illuminate\Contracts\Pagination\CursorPaginator;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;

class CompanyProximitySearch extends TableWidget
{
use CanPaginateRecords;

public ?Model $record = null;

protected int|string|array $columnSpan = 'full';

protected function paginateTableQuery(Builder $query): CursorPaginator
{
return $query->cursorPaginate(($this->getTableRecordsPerPage() === 'all') ? $query->count() : $this->getTableRecordsPerPage());
}
use App\Filament\Resources\CompanyResource;
use App\Models\Company;
use Filament\Forms\Components\TextInput;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Concerns\CanPaginateRecords;
use Filament\Tables\Enums\FiltersLayout;
use Filament\Tables\Filters\Filter;
use Filament\Tables\Table;
use Filament\Widgets\TableWidget;
use Illuminate\Contracts\Pagination\CursorPaginator;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;

class CompanyProximitySearch extends TableWidget
{
use CanPaginateRecords;

public ?Model $record = null;

protected int|string|array $columnSpan = 'full';

protected function paginateTableQuery(Builder $query): CursorPaginator
{
return $query->cursorPaginate(($this->getTableRecordsPerPage() === 'all') ? $query->count() : $this->getTableRecordsPerPage());
}
8 replies
FFilament
Created by Prodex on 10/28/2024 in #❓┊help
ExtraModalFooterAction does nothing
sorry, my example didn't cover this: What I wanted to achieve is a delete button in the footer of the edit modal. I've already tried ->action(fn ($record) => $record->delete()) which didn't do anything.
6 replies
FFilament
Created by Prodex on 10/28/2024 in #❓┊help
ExtraModalFooterAction does nothing
How would you implement this kind of feature to delete records in edit modal?
6 replies
FFilament
Created by Prodex on 1/11/2024 in #❓┊help
Sub Navigation in ListView for Custom Page
yes, Filament introduced "clusters" after this issue, which solves the problem by just using them instead of the RecordSubNavigation method. https://filamentphp.com/docs/3.x/panels/clusters
4 replies
FFilament
Created by Prodex on 6/10/2024 in #❓┊help
Custom recordAction()
that worked, thanks!
4 replies
FFilament
Created by Prodex on 5/10/2024 in #❓┊help
How can I avoid N+1 problem in custom views?
perfect, that worked. Thank you!
5 replies
FFilament
Created by Prodex on 4/26/2024 in #❓┊help
How to show a slideover infolist view when clicking a row in a resource table?
that easy? Oh wow, I couldn’t find recordAction documented. Can’t test now, but will do tomorrow ❤️
7 replies
FFilament
Created by Prodex on 4/26/2024 in #❓┊help
How to show a slideover infolist view when clicking a row in a resource table?
Yeah but I want it to be activated when clicking the row not having an action button for it
7 replies
FFilament
Created by Prodex on 4/26/2024 in #❓┊help
How to show a slideover infolist view when clicking a row in a resource table?
Anyone?
7 replies
FFilament
Created by Prodex on 3/26/2024 in #❓┊help
Gantt Chart with Livewire / Filament / AlpineJS
yeah the main thing is not that I have trouble displaying timeline / gantt data, but that you can actually interact with these or at least open a modal on click to change values, you know?
3 replies
FFilament
Created by Prodex on 2/9/2024 in #❓┊help
Include JS Asset: "Identifier X has already been declared"
that's not working, how should the compiled version hash be resolved?
3 replies
FFilament
Created by Prodex on 1/17/2024 in #❓┊help
Calling Action Modal from parent livewire component
okay, thanks!
9 replies
FFilament
Created by Prodex on 1/17/2024 in #❓┊help
Calling Action Modal from parent livewire component
it seems to work fine. I was just wondering, because I read on the filament website that modals inside the panel are reusable, so I was confused, why it doesn't work that way.
9 replies
FFilament
Created by Prodex on 1/17/2024 in #❓┊help
Calling Action Modal from parent livewire component
If I place it in the parent, the model doesn't show up (also, no JS error). It only shows up, if it's inside the card component
9 replies
FFilament
Created by Prodex on 1/8/2024 in #❓┊help
QueryBuilder Filter returns nothing
anyone? 🙏
4 replies
FFilament
Created by Prodex on 1/8/2024 in #❓┊help
QueryBuilder Filter returns nothing
After some debugging, I figured out, that the query is using "id" to resolve the column of the relation, but my relation is actually using a different name for that:
public function article(): BelongsTo
{
return $this->belongsTo(Article::class, 'billomat_article_id', 'billomat_id');
}
public function article(): BelongsTo
{
return $this->belongsTo(Article::class, 'billomat_article_id', 'billomat_id');
}
How can I modify the query, so that it uses the correct column name? It needs to be "billomat_id" in order to work.
4 replies