frame
frame
FFilament
Created by frame on 1/15/2025 in #❓┊help
Style tenant dropdown when user only has access to a single tenant
I would like to remove hover effects and the arrow down icon if the user only has a single tenant. Is that possible? I am not using a tenant profile page or other tenant menu items.
9 replies
FFilament
Created by frame on 1/15/2025 in #❓┊help
Highlight changed/added rows using $table->recordClasses
I want to highlight rows that were changed or added until the user navigates away or does another change. I tried saving record IDs with session()->flash, but the rows are only highlighted for half a second until the notification appears and the table is redrawn without session flash. Are there better ways to temporarily save highlighted row IDs for a user so I could use it in recordClasses? 🤔
2 replies
FFilament
Created by frame on 1/14/2025 in #❓┊help
Overriding Filepond labels
uploadingMessage corresponds to labelFileLoading but can I also override the other labels? https://pqina.nl/filepond/docs/api/instance/properties/#labels
4 replies
FFilament
Created by frame on 1/14/2025 in #❓┊help
FileUpload file validation after upload, before submit
Is it possible to validate a FileUpload field before submit? I can access the uploaded file using afterStateUpdated and similar functions, but is there any function other than rules that has access to $fail? I tried throwing ValidationError, etc but those didn't seem to work.
5 replies
FFilament
Created by frame on 1/13/2025 in #❓┊help
How to submit disabled fields
Is there something similar to immutable fields from Nova in Filament, so submit the field even if its disabled for the user. Or do I always need a pairing Hidden input for that use case? I tried readOnly but it's only available on Textinput. https://nova.laravel.com/docs/v5/resources/fields#immutable-fields
5 replies
FFilament
Created by frame on 1/10/2025 in #❓┊help
Custom resource page $this->record null when searching/sorting
The table renders fine initially, but when trying to sort or search $this->record is null. Am I missing some trait or something? 🤔 Same question as this removed one https://discord.com/channels/883083792112300104/1301012727036121219
<?php

namespace App\Filament\Instructors\Resources\GroupResource\Pages;

use App\Filament\Instructors\Resources\GroupResource;
use App\Models\ExerciseResult;
use App\Models\Group;
use Filament\Actions\Concerns\InteractsWithRecord;
use Filament\Actions\Contracts\HasRecord;
use Filament\Resources\Pages\Page;
use Filament\Tables;
use Filament\Tables\Concerns\InteractsWithTable;
use Filament\Tables\Contracts\HasTable;
use Filament\Tables\Table;

class SimpleResults extends Page implements HasRecord, HasTable
{
use InteractsWithRecord;
use InteractsWithTable;

public function mount(string $record): void
{
$this->record = Group::where('uuid', $record)->firstOrFail();
}

protected static string $resource = GroupResource::class;

protected static string $view = 'filament.instructors.resources.group-resource.pages.simple-results';

public function getModel(): string
{
return Group::class;
}

public function table(Table $table)
{
return $table
->query(function () {
dump($this->record); // null if searching/sorting

return ExerciseResult::forGroup($this->record);
})
->columns([
Tables\Columns\TextColumn::make('created_at')
->label('Created at')
->sortable()
->searchable(),
])
->actions([]);
}
}
<?php

namespace App\Filament\Instructors\Resources\GroupResource\Pages;

use App\Filament\Instructors\Resources\GroupResource;
use App\Models\ExerciseResult;
use App\Models\Group;
use Filament\Actions\Concerns\InteractsWithRecord;
use Filament\Actions\Contracts\HasRecord;
use Filament\Resources\Pages\Page;
use Filament\Tables;
use Filament\Tables\Concerns\InteractsWithTable;
use Filament\Tables\Contracts\HasTable;
use Filament\Tables\Table;

class SimpleResults extends Page implements HasRecord, HasTable
{
use InteractsWithRecord;
use InteractsWithTable;

public function mount(string $record): void
{
$this->record = Group::where('uuid', $record)->firstOrFail();
}

protected static string $resource = GroupResource::class;

protected static string $view = 'filament.instructors.resources.group-resource.pages.simple-results';

public function getModel(): string
{
return Group::class;
}

public function table(Table $table)
{
return $table
->query(function () {
dump($this->record); // null if searching/sorting

return ExerciseResult::forGroup($this->record);
})
->columns([
Tables\Columns\TextColumn::make('created_at')
->label('Created at')
->sortable()
->searchable(),
])
->actions([]);
}
}
5 replies
FFilament
Created by frame on 1/10/2025 in #❓┊help
Query string null in a relationmanager
I can read request()->query('group') in ViewUser::getTitle just fine but in UserResource's ResultsRelationManager it returns null. Is there a way to read URL query strings in a relationmanager, or some other way to pass data from Resource to Relationmanager? I need to alter both UserResource infolist and the ResultsRelationManager table under it based on this query string. 🤔
13 replies
FFilament
Created by frame on 1/3/2025 in #❓┊help
How to redirect panel base path to resource index
If I don't need a dashboard how do i redirect the base /admin path to for example UserResource list?
4 replies
FFilament
Created by frame on 1/2/2025 in #❓┊help
Mystery `Action::table` method missing
I want to create my own import action by modifying Filament's ImportAction. But I'm missing the table method, does anyone know how I'm supposed to provide it? 🤔
Method App\Filament\MyImportAction::table does not exist.
C:\Herd\project\vendor\filament\support\src\Concerns\Macroable.php:72
Method App\Filament\MyImportAction::table does not exist.
C:\Herd\project\vendor\filament\support\src\Concerns\Macroable.php:72
4 replies
FFilament
Created by frame on 12/31/2024 in #❓┊help
Adding where clause to query using current session
Can I always filter UserResource rows to only rows that belong to the same group as the current logged in user ($query->where('group_id', auth()->user()->group_id)? Where would I apply such a where clause? getTableQuery says deprecated — Override the table() method to configure the table so I'm not sure how to do it 🤔
6 replies
FFilament
Created by frame on 12/31/2024 in #❓┊help
Table groups with 5 newest rows per group
When using table groups is it possible to limit each group to 5 newest rows? 🤔
4 replies
FFilament
Created by frame on 12/30/2024 in #❓┊help
Searchable by pivot name
In a relationmanager I have records with column name and a pivot column name. How do i make the table searchable by the pivot column? I already tried Tables\Columns\TextColumn::make('name')->searchable() (column works, search doesn't), Tables\Columns\TextColumn::make('pivot.name')->searchable() (column works, search doesn't) and Tables\Columns\TextColumn::make('pivot_table_name.name')->searchable() (neither works).
4 replies
FFilament
Created by frame on 12/30/2024 in #❓┊help
TextEntry as link to related resource
What's the easiest way to make Infolists\Components\TextEntry::make('client.name') link to the client's view page?
5 replies
FFilament
Created by frame on 12/27/2024 in #❓┊help
Click ViewAction in RelationManager to view resource
With User hasmany Posts, If I have a UserResource\RelationManagers\PostsRelationManager how do I make its ViewAction to forward to ViewPost page, instead of showing the default modal popup?
3 replies