Jakub
Jakub
FFilament
Created by Venky on 10/26/2024 in #❓┊help
Table reload in custom livewire tab by updating in another tab table record.
if you can share screenshots of how the view looks, and what you want to do with it. Might be able to help more. I am not that great at filament yet, to fully visualize how everythings works just from code =/
12 replies
FFilament
Created by Venky on 10/26/2024 in #❓┊help
Table reload in custom livewire tab by updating in another tab table record.
I think you made it more complex than it needs to be with the custom livewire stuff, to get the same result
12 replies
FFilament
Created by Venky on 10/26/2024 in #❓┊help
Table reload in custom livewire tab by updating in another tab table record.
Full code for the page if that ehlps
12 replies
FFilament
Created by Venky on 10/26/2024 in #❓┊help
Table reload in custom livewire tab by updating in another tab table record.
No description
12 replies
FFilament
Created by Venky on 10/26/2024 in #❓┊help
Table reload in custom livewire tab by updating in another tab table record.
From my understanding you are doing the following - created info list that has tabs , so you can swtich and show different tables - you click on a tab Draft, and it shows listings with status of draft - click on tab of published, shows active listings - you are passing in a custom livewire component for each one What you should do in this situation - create a new page or go on the ListListings page - create the getTabs function and setup filters on that - you can pass in fitlers directly onto the tabs - so wheenver yo uswitch between tabs, the table updates - creating new records will also refresh the table Here is example of some tabs i have
if ($submittedTasksCount > 0) {
$tabs['submitted'] = Tab::make('submitted')
->label('')
->icon('heroicon-o-inbox')
->badge($submittedTasksCount)
->badgeColor('purple')
->modifyQueryUsing(function (Builder $query) {
return $query->where('status', EStatus::SUBMITTED);
});
}

if ($feedbackTasksCount > 0) {
$tabs['feedback'] = Tab::make('feedback')
->icon('heroicon-o-chat-bubble-bottom-center-text')
->label('')
->badge($activeFeedbackTasksCount > 0 ? $activeFeedbackTasksCount : null)
->badgeColor('yellow')
->modifyQueryUsing(function (Builder $query) {
return $query->where('type', ETaskType::QUESTION);
});
}
if ($submittedTasksCount > 0) {
$tabs['submitted'] = Tab::make('submitted')
->label('')
->icon('heroicon-o-inbox')
->badge($submittedTasksCount)
->badgeColor('purple')
->modifyQueryUsing(function (Builder $query) {
return $query->where('status', EStatus::SUBMITTED);
});
}

if ($feedbackTasksCount > 0) {
$tabs['feedback'] = Tab::make('feedback')
->icon('heroicon-o-chat-bubble-bottom-center-text')
->label('')
->badge($activeFeedbackTasksCount > 0 ? $activeFeedbackTasksCount : null)
->badgeColor('yellow')
->modifyQueryUsing(function (Builder $query) {
return $query->where('type', ETaskType::QUESTION);
});
}
The table on the same page is like this
public function table(Table $table): Table
{
return parent::table($table)
->defaultGroup('project.name')
->defaultPaginationPageOption(50)
->poll('30')
->modifyQueryUsing(
fn (Builder $query) => $query
->with([
'project',
'thread',
'activeTimeRecords'
])
->whereIn('status', [EStatus::ACTIVE, EStatus::SUBMITTED, EStatus::QUEUED, EStatus::COMPLETED])
->whereHas('workspace', fn ($q) => $q->where('is_active', true))
)->emptyStateHeading('No tasks found.');
}
public function table(Table $table): Table
{
return parent::table($table)
->defaultGroup('project.name')
->defaultPaginationPageOption(50)
->poll('30')
->modifyQueryUsing(
fn (Builder $query) => $query
->with([
'project',
'thread',
'activeTimeRecords'
])
->whereIn('status', [EStatus::ACTIVE, EStatus::SUBMITTED, EStatus::QUEUED, EStatus::COMPLETED])
->whereHas('workspace', fn ($q) => $q->where('is_active', true))
)->emptyStateHeading('No tasks found.');
}
I could be misunderstanding the whole thing too lol
12 replies
FFilament
Created by trovster on 8/25/2023 in #❓┊help
Extra modal actions, trigger edit modal action and open link
did you ever get this working?
3 replies
FFilament
Created by Sydd on 4/19/2024 in #❓┊help
canView widget
@hrank8t @Hugo if ur still looking for answer
17 replies
FFilament
Created by Sydd on 4/19/2024 in #❓┊help
canView widget
I got this working like this you access the record there and just pass in the widget or not In the ViewResource page
protected function getHeaderWidgets(): array
{
$feedbackRequestsCount = Task::where('thread_id', $this->record->id)
->whereIn('status', [EStatus::ACTIVE, EStatus::SUBMITTED])
->where('type', ETaskType::QUESTION)
->count();

if ($feedbackRequestsCount > 0) {
return [
ThreadFeedbackRequestsTableWidget::class,
];
} else {
return [];
}
}
protected function getHeaderWidgets(): array
{
$feedbackRequestsCount = Task::where('thread_id', $this->record->id)
->whereIn('status', [EStatus::ACTIVE, EStatus::SUBMITTED])
->where('type', ETaskType::QUESTION)
->count();

if ($feedbackRequestsCount > 0) {
return [
ThreadFeedbackRequestsTableWidget::class,
];
} else {
return [];
}
}
17 replies
FFilament
Created by Jakub on 9/7/2024 in #❓┊help
how to access current state of repeater item?
Just looking for a way to access title in the loop
6 replies
FFilament
Created by Jakub on 9/7/2024 in #❓┊help
how to access current state of repeater item?
No description
6 replies
FFilament
Created by Abi on 2/27/2024 in #❓┊help
binding an array to a repeatable entry on infolists
where u able to get this working?
4 replies
FFilament
Created by Jakub on 1/13/2024 in #❓┊help
slide-over direction
nope =/
6 replies
FFilament
Created by Szilárd on 7/16/2024 in #❓┊help
How to make a third level menu in navigation?
No description
9 replies
FFilament
Created by Szilárd on 7/16/2024 in #❓┊help
How to make a third level menu in navigation?
@Szilárd every find out how to do this?
9 replies
FFilament
Created by bernhard on 1/22/2024 in #❓┊help
"Create another" and prefill field
im new to filament too haha but maybe
5 replies
FFilament
Created by bernhard on 1/22/2024 in #❓┊help
"Create another" and prefill field
maybe that would pass into the new instance of the form
5 replies
FFilament
Created by bernhard on 1/22/2024 in #❓┊help
"Create another" and prefill field
https://filamentphp.com/docs/3.x/actions/prebuilt-actions/create#lifecycle-hooks Just shooting in the dark, but maybe this would work
->after(function () {
// Runs after the form fields are saved to the database.
})
->after(function () {
// Runs after the form fields are saved to the database.
})
passing in $data as variable and returning $data with certain fields being null
5 replies
FFilament
Created by Jakub on 6/4/2024 in #❓┊help
Using Resource table in custom livewire component
video of what im referring too
5 replies
FFilament
Created by Jakub on 6/4/2024 in #❓┊help
Using Resource table in custom livewire component
Inbox filament page
<?php

class Inbox extends Page
{
protected static ?string $navigationIcon = 'heroicon-o-inbox';

protected static string $view = 'filament.pages.inbox';

public function getTabs(): array
{
return [
'All' => Tab::make('All')->schema([
Livewire::make(ActiveTasksTable::class)->key('active-tasks-table')
]),
];
}

public function infolist(Infolist $infolist): Infolist
{
return $infolist
->schema([
Tabs::make('Tabs')->contained(false)
->tabs([
Tabs\Tab::make('active-tasks')->label('Active Tasks')
->schema([
Livewire::make(ActiveTasksTable::class)->key('active-tasks-table')
]),
Tabs\Tab::make('Tab 2')
->schema([
Livewire::make(ActiveTasksTable::class)->key('active-tasks-table-2')->lazy()
]),
Tabs\Tab::make('Tab 3')
->schema([
Livewire::make(ActiveTasksTable::class)->key('active-tasks-table-3')->lazy()
]),
]),
]);
}
}
<?php

class Inbox extends Page
{
protected static ?string $navigationIcon = 'heroicon-o-inbox';

protected static string $view = 'filament.pages.inbox';

public function getTabs(): array
{
return [
'All' => Tab::make('All')->schema([
Livewire::make(ActiveTasksTable::class)->key('active-tasks-table')
]),
];
}

public function infolist(Infolist $infolist): Infolist
{
return $infolist
->schema([
Tabs::make('Tabs')->contained(false)
->tabs([
Tabs\Tab::make('active-tasks')->label('Active Tasks')
->schema([
Livewire::make(ActiveTasksTable::class)->key('active-tasks-table')
]),
Tabs\Tab::make('Tab 2')
->schema([
Livewire::make(ActiveTasksTable::class)->key('active-tasks-table-2')->lazy()
]),
Tabs\Tab::make('Tab 3')
->schema([
Livewire::make(ActiveTasksTable::class)->key('active-tasks-table-3')->lazy()
]),
]),
]);
}
}
Issue When I am on the custom page and i click on the edit button, it shows a blank modal. I can't click on the rows either. But when I go on the tasks resource , everything works as intended. Question Is this is a limitation in general with https://filamentphp.com/docs/3.x/tables/adding-a-table-to-a-livewire-component Or am I missing some trait that would solve this?
5 replies
FFilament
Created by Jakub on 6/4/2024 in #❓┊help
Using Resource table in custom livewire component
ActiveTasksTable the lviewire component
class ActiveTasksTable extends Component implements HasForms, HasTable
{
use InteractsWithTable;
use InteractsWithForms;

public function table(Table $table): Table
{
$activeTasks = Task::where('status', EStatus::ACTIVE)
->where('is_reconciled', false)
->where('is_approved', false);

return TaskResource::table($table->query($activeTasks));
}

}

// blade part
<div>
{{ $this->table }}
</div>
class ActiveTasksTable extends Component implements HasForms, HasTable
{
use InteractsWithTable;
use InteractsWithForms;

public function table(Table $table): Table
{
$activeTasks = Task::where('status', EStatus::ACTIVE)
->where('is_reconciled', false)
->where('is_approved', false);

return TaskResource::table($table->query($activeTasks));
}

}

// blade part
<div>
{{ $this->table }}
</div>
5 replies