SuperUserDo
SuperUserDo
FFilament
Created by SuperUserDo on 2/6/2025 in #❓┊help
Issue With Modal on Table Column
Hello, I have an issue with table column, when i add getStateUsing with new HtmlString(), a add wire:click openColumnHsitory with $recordId and $column (as pure string). In my openColumnHistory() method i recieve everything so that is good, but was wondering how to accept data from params on front and to use in modal heading?
public function openColumnHistory ($id, $column): void
{
$this->dispatch('open-modal', id: 'column-history', params: [
'id' => $id,
'column' => $column
]);
}
public function openColumnHistory ($id, $column): void
{
$this->dispatch('open-modal', id: 'column-history', params: [
'id' => $id,
'column' => $column
]);
}
This is my page
<x-filament-panels::page>
{{ $this->table }}

<x-filament::modal id="column-history" slide-over>
<x-slot name="heading">
{{ ucfirst($column ?? '') }} - Column History
</x-slot>
</x-filament::modal>
</x-filament-panels::page>
<x-filament-panels::page>
{{ $this->table }}

<x-filament::modal id="column-history" slide-over>
<x-slot name="heading">
{{ ucfirst($column ?? '') }} - Column History
</x-slot>
</x-filament::modal>
</x-filament-panels::page>
1 replies
FFilament
Created by SuperUserDo on 2/5/2025 in #❓┊help
Custom Page Table Method Edit Action passing Current Record
Hello, Is it possible to pass current record within view on custom filament page under table method?
->actions([
EditAction::make()
->modalHeading('Edit Location')
->modalSubmitActionLabel('Save Changes')
->successNotificationTitle('Location updated successfully')
->view('filament.pages.user-data.location-edit')
,
])
->actions([
EditAction::make()
->modalHeading('Edit Location')
->modalSubmitActionLabel('Save Changes')
->successNotificationTitle('Location updated successfully')
->view('filament.pages.user-data.location-edit')
,
])
I have tried accessing $record within view I get
Filament\Tables\Actions\EditAction::record(Illuminate\Database\Eloquent\Model|Closure|null $record): static {#4610 ▼ // resources\views/filament/pages/user-data/location-edit.blade.php
returnType: "static"
this:
Filament\Tables\Actions
\
EditAction {#2858 …}
}
Filament\Tables\Actions\EditAction::record(Illuminate\Database\Eloquent\Model|Closure|null $record): static {#4610 ▼ // resources\views/filament/pages/user-data/location-edit.blade.php
returnType: "static"
this:
Filament\Tables\Actions
\
EditAction {#2858 …}
}
Also closure funciton within view do not work... Any idea how to pass current record?
3 replies
FFilament
Created by SuperUserDo on 2/4/2025 in #❓┊help
Searchable Has Many Issue
Greetings, I was wondering how can i make column searchable by InventoryLocation name and also UserLocations.name but latest only. I have tried whereHas with subQuery but it does not work.. Any idea how to make it work?
public function table(Table $table): Table
{
return $table
->query(InventoryLocation::query()->with([
'userLocations' => function ($query) {
$query->latest()
->take(1);
},
]))
->columns([
TextColumn::make('name')
->getStateUsing(fn ($record) => $record->userLocations?->first()->data['name'] ?? $record->name)
->label('Location Name')
->searchable(query: function ($query, $search) {
$query->where('name', 'like', "%{$search}%");
})
->sortable(),
public function table(Table $table): Table
{
return $table
->query(InventoryLocation::query()->with([
'userLocations' => function ($query) {
$query->latest()
->take(1);
},
]))
->columns([
TextColumn::make('name')
->getStateUsing(fn ($record) => $record->userLocations?->first()->data['name'] ?? $record->name)
->label('Location Name')
->searchable(query: function ($query, $search) {
$query->where('name', 'like', "%{$search}%");
})
->sortable(),
5 replies
FFilament
Created by SuperUserDo on 1/23/2025 in #❓┊help
Issue with Filament modal, Livewire And Lazy Load
Hi, I had lazy loaded disabled and i am getting issue that i am unable to lazy load component even tho i did use ->with(), i think it is up to Livewire so tought to ask here if someone had similar issue?
<?php

namespace App\Livewire;

use App\Models\User;
use Illuminate\Support\Facades\Auth;
use Livewire\Attributes\Lazy;
use Livewire\Component;

#[Lazy]
class Guide extends Component
{
public $guides;

public function mount ()
{
$this->guides = \App\Models\Guide::query()->with(['parent', 'children',])->get();
}

public function render()
{
return view('livewire.guide');
}

public function openModal($userId = null): void
{
$user = $userId
? User::findOrFail($userId)
: Auth::user();


$this->userData = $user->toArray();
$this->dispatch('open-modal', id: 'guide-modal');
}
}
<?php

namespace App\Livewire;

use App\Models\User;
use Illuminate\Support\Facades\Auth;
use Livewire\Attributes\Lazy;
use Livewire\Component;

#[Lazy]
class Guide extends Component
{
public $guides;

public function mount ()
{
$this->guides = \App\Models\Guide::query()->with(['parent', 'children',])->get();
}

public function render()
{
return view('livewire.guide');
}

public function openModal($userId = null): void
{
$user = $userId
? User::findOrFail($userId)
: Auth::user();


$this->userData = $user->toArray();
$this->dispatch('open-modal', id: 'guide-modal');
}
}
2 replies
FFilament
Created by SuperUserDo on 12/11/2024 in #❓┊help
Hide Profile Menu Item
No description
13 replies
FFilament
Created by SuperUserDo on 12/11/2024 in #❓┊help
Modal Dynamic Content
No description
4 replies
FFilament
Created by SuperUserDo on 11/26/2024 in #❓┊help
Database Notification Mark As Read
Hi fellas, i have this database notification Mark as read is working, but how do i hide that button after that notification is read? <?php namespace App\Notifications; use App\Models\User; use Filament\Notifications\Actions\Action; use Filament\Notifications\Notification as FilamentNotification; use Illuminate\Bus\Queueable; use Illuminate\Notifications\Notification; class DatabaseNotification extends Notification { use Queueable; public function __construct( protected string $view, protected string $title, protected array $data = [], ) {} public function via(object $notifiable): array { return ['database']; } public function toDatabase(User $notifiable): array { return FilamentNotification::make() ->title($this->title) ->body(view($this->view, ['data' => $this->data])) ->actions([ Action::make('Mark as read') ->button() ->markAsRead() , ]) ->getDatabaseMessage(); } }
2 replies
FFilament
Created by SuperUserDo on 11/24/2024 in #❓┊help
Table Reordering Wont Trigger Model boot() method to clear cache
Hi, I have an issue when i am reordering table rows, it reorders it but it wont hit that Model's boot() method to clear cache. In my boot method I have tried, updating, updated, saved... Any way around it?
2 replies
FFilament
Created by SuperUserDo on 11/20/2024 in #❓┊help
Remove Title On Pages
No description
4 replies
FFilament
Created by SuperUserDo on 11/18/2024 in #❓┊help
Table Caching
Hi guys, does filament support caching whole table? I have tried to cache whole response via middleware but it is not successful, $html does not load. But without filament when i cache whole response it works
2 replies
FFilament
Created by SuperUserDo on 11/15/2024 in #❓┊help
Custom Searchable Input/Select
No description
2 replies
FFilament
Created by SuperUserDo on 11/14/2024 in #❓┊help
Livewire/Filament Infolist Not Recognized
No description
2 replies
FFilament
Created by SuperUserDo on 11/14/2024 in #❓┊help
Implementation Of Tables within Expandable Row
Hi fellas, I Have a bit of challange to create expandable row with tabs within. And each tab should have own table (Preferablly livewire with implementation of Filament tables), is there any way to do it?
10 replies
FFilament
Created by SuperUserDo on 11/7/2024 in #❓┊help
Tiptap editor wont add <br> or indent text
No description
2 replies
FFilament
Created by SuperUserDo on 10/24/2024 in #❓┊help
TipTap Editor Issue
No description
4 replies
FFilament
Created by SuperUserDo on 10/21/2024 in #❓┊help
Reorder Table Clear Cache
No description
2 replies
FFilament
Created by SuperUserDo on 10/16/2024 in #❓┊help
TipTap Editor
No description
6 replies
FFilament
Created by SuperUserDo on 10/15/2024 in #❓┊help
Custom Column Clickable - Prevent
No description
6 replies
FFilament
Created by SuperUserDo on 10/15/2024 in #❓┊help
Spatie Image Mass Assignment Issue
No description
3 replies
FFilament
Created by SuperUserDo on 10/14/2024 in #❓┊help
Reset password email - translation footer text
No description
5 replies