Jakub
Jakub
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
FFilament
Created by Jakub on 6/3/2024 in #❓┊help
Looking for advice: Creating custom page with multiple tabs + resource tables
@toeknee tytyty for the advice, i was so lost on this for to long lol Just somethign as simple as pointing that out helped so much haha
18 replies
FFilament
Created by Jakub on 6/3/2024 in #❓┊help
Looking for advice: Creating custom page with multiple tabs + resource tables
active tasks table
<div>
{{ $this->table }}
</div>
<div>
{{ $this->table }}
</div>
<?php

namespace App\Livewire\Agency\Inbox;

use Filament\Forms;
use App\Models\Task;
use Filament\Tables;
use App\Enums\EStatus;
use Livewire\Component;
use Filament\Forms\Form;
use App\Models\Milestone;
use Filament\Tables\Table;
use App\Models\Shop\Product;
use Filament\Resources\Resource;
use Illuminate\Contracts\View\View;
use Filament\Forms\Contracts\HasForms;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Contracts\HasTable;
use Illuminate\Database\Eloquent\Builder;

use App\Filament\Resources\MilestoneResource;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Tables\Concerns\InteractsWithTable;
use App\Filament\Resources\MilestoneResource\Pages;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use App\Filament\Resources\MilestoneResource\RelationManagers;

class ActiveTasksTable extends Component implements HasForms, HasTable
{
use InteractsWithTable;
use InteractsWithForms;

public static function table(Table $table): Table
{
return $table
->query(Milestone::query())
->columns([
Tables\Columns\TextColumn::make('name')
->searchable(),
Tables\Columns\TextColumn::make('project.name')
->searchable(),
Tables\Columns\TextColumn::make('status')
->sortable(),
Tables\Columns\TextColumn::make('priority')
->sortable(),
])
->recordUrl(fn (Milestone $record): string => MilestoneResource::getUrl('view', ['record' => $record->id]))
->filters([
Tables\Filters\TrashedFilter::make(),
])
->actions([
// Tables\Actions\ViewAction::make(),
// Tables\Actions\EditAction::make(),
// Tables\Actions\ViewAction::make()->url(fn (Milestone $record) => MilestoneResource::getUrl('view', ['record' => $record->id]))

])
->headerActions([
Tables\Actions\CreateAction::make()
->mutateFormDataUsing(fn (array $data): array => Milestone::mutateFormDataBeforeCreate($data))
->visible(url()->current() != MilestoneResource::getUrl('index')),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
Tables\Actions\ForceDeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(),
]),
]);
}


public function render()
{
return view('livewire.agency.inbox.active-tasks-table');
}
}
<?php

namespace App\Livewire\Agency\Inbox;

use Filament\Forms;
use App\Models\Task;
use Filament\Tables;
use App\Enums\EStatus;
use Livewire\Component;
use Filament\Forms\Form;
use App\Models\Milestone;
use Filament\Tables\Table;
use App\Models\Shop\Product;
use Filament\Resources\Resource;
use Illuminate\Contracts\View\View;
use Filament\Forms\Contracts\HasForms;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Contracts\HasTable;
use Illuminate\Database\Eloquent\Builder;

use App\Filament\Resources\MilestoneResource;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Tables\Concerns\InteractsWithTable;
use App\Filament\Resources\MilestoneResource\Pages;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use App\Filament\Resources\MilestoneResource\RelationManagers;

class ActiveTasksTable extends Component implements HasForms, HasTable
{
use InteractsWithTable;
use InteractsWithForms;

public static function table(Table $table): Table
{
return $table
->query(Milestone::query())
->columns([
Tables\Columns\TextColumn::make('name')
->searchable(),
Tables\Columns\TextColumn::make('project.name')
->searchable(),
Tables\Columns\TextColumn::make('status')
->sortable(),
Tables\Columns\TextColumn::make('priority')
->sortable(),
])
->recordUrl(fn (Milestone $record): string => MilestoneResource::getUrl('view', ['record' => $record->id]))
->filters([
Tables\Filters\TrashedFilter::make(),
])
->actions([
// Tables\Actions\ViewAction::make(),
// Tables\Actions\EditAction::make(),
// Tables\Actions\ViewAction::make()->url(fn (Milestone $record) => MilestoneResource::getUrl('view', ['record' => $record->id]))

])
->headerActions([
Tables\Actions\CreateAction::make()
->mutateFormDataUsing(fn (array $data): array => Milestone::mutateFormDataBeforeCreate($data))
->visible(url()->current() != MilestoneResource::getUrl('index')),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
Tables\Actions\ForceDeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(),
]),
]);
}


public function render()
{
return view('livewire.agency.inbox.active-tasks-table');
}
}
18 replies
FFilament
Created by Jakub on 6/3/2024 in #❓┊help
Looking for advice: Creating custom page with multiple tabs + resource tables
Inbox blade
<x-filament-panels::page>



{{ $this->infolist }}

</x-filament-panels::page>
<x-filament-panels::page>



{{ $this->infolist }}

</x-filament-panels::page>
18 replies
FFilament
Created by Jakub on 6/3/2024 in #❓┊help
Looking for advice: Creating custom page with multiple tabs + resource tables
inbox page
<?php

namespace App\Filament\Pages;

use Filament\Pages\Page;
use Filament\Infolists\Infolist;
use Filament\Infolists\Components\Tabs;
use Filament\Infolists\Components\Livewire;
use App\Livewire\Agency\Inbox\ActiveTasksTable;
use Filament\Resources\Components\Tab;

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

namespace App\Filament\Pages;

use Filament\Pages\Page;
use Filament\Infolists\Infolist;
use Filament\Infolists\Components\Tabs;
use Filament\Infolists\Components\Livewire;
use App\Livewire\Agency\Inbox\ActiveTasksTable;
use Filament\Resources\Components\Tab;

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()
]),
]),
]);
}
}
18 replies
FFilament
Created by Jakub on 6/3/2024 in #❓┊help
Looking for advice: Creating custom page with multiple tabs + resource tables
No description
18 replies
FFilament
Created by Jakub on 6/3/2024 in #❓┊help
Looking for advice: Creating custom page with multiple tabs + resource tables
just needted to add ->contained(false) Found it here for future people https://filamentphp.com/docs/3.x/infolists/layout/tabs#removing-the-styled-container
18 replies
FFilament
Created by Jakub on 6/3/2024 in #❓┊help
Looking for advice: Creating custom page with multiple tabs + resource tables
<?php

namespace App\Filament\Pages;

use Filament\Pages\Page;
use Filament\Infolists\Infolist;
use Filament\Infolists\Components\Tabs;
use Filament\Infolists\Components\Livewire;
use App\Livewire\Agency\Inbox\ActiveTasksTable;

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

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

public function infolist(Infolist $infolist): Infolist
{
return $infolist
->schema([
Tabs::make('Tabs')
->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

namespace App\Filament\Pages;

use Filament\Pages\Page;
use Filament\Infolists\Infolist;
use Filament\Infolists\Components\Tabs;
use Filament\Infolists\Components\Livewire;
use App\Livewire\Agency\Inbox\ActiveTasksTable;

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

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

public function infolist(Infolist $infolist): Infolist
{
return $infolist
->schema([
Tabs::make('Tabs')
->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()
]),
]),
]);
}
}
Trying it out with infolsits if it had any diffrences, trying to get the regular tabs style
18 replies
FFilament
Created by Jakub on 6/3/2024 in #❓┊help
Looking for advice: Creating custom page with multiple tabs + resource tables
@toeknee this actually worked out pretty well, thanks bud
18 replies
FFilament
Created by Jakub on 6/3/2024 in #❓┊help
Looking for advice: Creating custom page with multiple tabs + resource tables
No description
18 replies
FFilament
Created by Jakub on 6/3/2024 in #❓┊help
Looking for advice: Creating custom page with multiple tabs + resource tables
I just tried making a INboxResource thinking i could get around that lol and add relationships to it
18 replies
FFilament
Created by Jakub on 6/3/2024 in #❓┊help
Looking for advice: Creating custom page with multiple tabs + resource tables
🤔 im going to tinker with that now
18 replies
FFilament
Created by Jakub on 6/3/2024 in #❓┊help
Looking for advice: Creating custom page with multiple tabs + resource tables
<?php

namespace App\Filament\Pages;

use Filament\Pages\Page;

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

protected static string $view = 'filament.pages.inbox';
}
<?php

namespace App\Filament\Pages;

use Filament\Pages\Page;

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

protected static string $view = 'filament.pages.inbox';
}
If it helps lol fresh page created again
18 replies
FFilament
Created by Jakub on 6/3/2024 in #❓┊help
Looking for advice: Creating custom page with multiple tabs + resource tables
I created a screenshot of what i want, just takign a screenshot of a relationsimp manager from workspace and adding it on the inbox page. That's really alli want to setup
18 replies
FFilament
Created by Jakub on 6/3/2024 in #❓┊help
Looking for advice: Creating custom page with multiple tabs + resource tables
If this is something way to advanced for somone new to filament to do (5 months experiance) please let me know as well, so i can try other solutions. If I am over my heado n this
18 replies