Sydd
Sydd
FFilament
Created by Sydd on 6/19/2024 in #❓┊help
global search sort results
Please, i looking for solution sort global search results by column date_at descending, try this, but dont work:
public static function getGlobalSearchResults(string $search): Collection
{
return parent::getGlobalSearchResults($search)->sortByDesc('date_at');
}
public static function getGlobalSearchResults(string $search): Collection
{
return parent::getGlobalSearchResults($search)->sortByDesc('date_at');
}
5 replies
FFilament
Created by Sydd on 5/28/2024 in #❓┊help
fileUpload download file directly to download folder
Pleas, probably i'm doing something wrong, i use file upload component with s3, everything works fine, but when trigger downloadable button the file is opened in new tab in the browser. Is any possibility to set downloads directly ? or as i think create maybe hint action, with custom method...
2 replies
FFilament
Created by Sydd on 5/27/2024 in #❓┊help
Two navigation badges
Dear all, is possible to set two navigation badges for resource in sidebar panel ?
4 replies
FFilament
Created by Sydd on 5/21/2024 in #❓┊help
Spatie media libary and S3 -> disk cannot be accesed
No description
13 replies
FFilament
Created by Sydd on 5/12/2024 in #❓┊help
saade autograph load signature
Dear all, I would ask if someone used plugin Saade autograph ... i try to load user signature from user model ? In DB is stored as base64 format. I'm trying do it from hint action but without succes result, any ideas to solve code below ? Probably some advice from more experienaced permanentne with $set ... I new with this.
SignaturePad::make('signatureTrainedUser')
->label(__('app.fireBrigade.ppls.adp.signatureTrainedUser'))
->dotSize(2.0)
->lineMinWidth(0.5)
->lineMaxWidth(2.5)
->throttle(16)
->minDistance(5)
->velocityFilterWeight(0.7)
->live()
->hintAction(
Forms\Components\Actions\Action::make('loadSignature')
->label(__('app.general.loadSignature'))
->color('info')
->icon('tabler-signature')
->action(function (Set $set) {
return $set('signatureTrainedUser', User::find(auth()->id())->signatureUser);
})
),
SignaturePad::make('signatureTrainedUser')
->label(__('app.fireBrigade.ppls.adp.signatureTrainedUser'))
->dotSize(2.0)
->lineMinWidth(0.5)
->lineMaxWidth(2.5)
->throttle(16)
->minDistance(5)
->velocityFilterWeight(0.7)
->live()
->hintAction(
Forms\Components\Actions\Action::make('loadSignature')
->label(__('app.general.loadSignature'))
->color('info')
->icon('tabler-signature')
->action(function (Set $set) {
return $set('signatureTrainedUser', User::find(auth()->id())->signatureUser);
})
),
4 replies
FFilament
Created by Sydd on 5/7/2024 in #❓┊help
Relation manager only on view page
Guys, please let me know if is possible to display relation manager table only on main resource view page, (disabled on edit page). Thanks for answers.
6 replies
FFilament
Created by Sydd on 5/2/2024 in #❓┊help
getRecordTitleAttribute from related model
Dear all, last time I have a lot of question. Please how can I create record title attibute from realated mode? for getGloballySearchableAttributes it works fine, but for getRecordTitleAttribute; in the Filament docs I read that it's must be a column / attributefrom model ... but is possible to get from related model ?
public static function getRecordTitleAttribute(): ?string
{
return 'user.fullName'; //not working
}

public static function getGloballySearchableAttributes(): array
{
return ['user.fullName']; // working fine
}
public static function getRecordTitleAttribute(): ?string
{
return 'user.fullName'; //not working
}

public static function getGloballySearchableAttributes(): array
{
return ['user.fullName']; // working fine
}
19 replies
FFilament
Created by Sydd on 5/1/2024 in #❓┊help
filter record in relations model
Hello everyone, I want some advice, direction... I have a Truck Driver model that is related to the db table drives... on the index page where all the truck drivers are, I show the number of kilometers per year, month, etc. how to correctly set such a filter ... so that I only have distinct values ​​from the db tables drives ... and then the query is also correctly adjusted in the driver according to the selected year. As stated below ... the filter returns the $id of records in drives with years, so I have 256x 2023 ... etc. If someone would direct me in which direction to go for the solution. Well thank you.
SelectFilter::make('year')
->label('Year')
->native(false)
->relationship('drives', 'year')
->options(Drive::query()->select('year')->distinct()->get()->pluck('year', 'year')->toArray())
SelectFilter::make('year')
->label('Year')
->native(false)
->relationship('drives', 'year')
->options(Drive::query()->select('year')->distinct()->get()->pluck('year', 'year')->toArray())
Seems to ->options dont aply to filer ....
6 replies
FFilament
Created by Sydd on 4/29/2024 in #❓┊help
Select mofiyQueryUsing return only Id on relationship
Dear all, according code under, is modified query but returned to options ID, not name ..., and is possible to show searchable only if option is more than 6 ? Select::make('safirsBranch_id') ->label(('app.safirs.safirsBranch')) ->relationship('safirsBranch', 'safirsBranchName', fn (Builder $query) => $query->where('id', auth()->user()->safirsBranches->pluck('id')->toArray())) ->required() ->native(false) //->searchable() if count of options is more than 6 ->searchable() ->preload() ->placeholder(('app.safirs.safirsBranch')),
4 replies
FFilament
Created by Sydd on 4/28/2024 in #❓┊help
TextEntry roles badge translations
Dear all, please advice me, how to translate roles in TextEntry badges ..., I'm try but, it's dont work, returned values as stored in DB. TextEntry::make(('app.role.roles')) ->label(('app.role.roles')) ->badge() ->color('primary') ->separator(','),
5 replies
FFilament
Created by Sydd on 4/26/2024 in #❓┊help
Shield resource discover
Dear all, i change my filament to another DB, and after this Shield, don discover resources -- generate all, create permission but in the shield UI dont see anything, only roles ..., any idea where can be problem ?
5 replies
FFilament
Created by Sydd on 4/23/2024 in #❓┊help
table column dont display value from resource
Dear all, why column with values from table dont show in the column ? 2 hours its works, but something going wrong and i dont know what ... resurce is from user model, name is displayed, but fullName, email etc. not. public static function table(Table $table): Table { return $table ->columns([ TextColumn::make('name'), TextColumn::make('fullName'), TextColumn::make('email'),
11 replies
FFilament
Created by Sydd on 4/22/2024 in #❓┊help
Global search result in modal
Hello, let me ask if is possible to display global search result in modal ? (like in tables without view url). Thank for answers.
2 replies
FFilament
Created by Sydd on 4/19/2024 in #❓┊help
canView widget
Hi all how can i use public static function canView() in widget class, i want to display chart only for users with any role ...
14 replies
FFilament
Created by Sydd on 4/18/2024 in #❓┊help
Logger plugin only for super_admin
Please anybody know how to set config logger plugin availably onyl for usres with role super-admin ?
5 replies
FFilament
Created by Sydd on 4/16/2024 in #❓┊help
Invalid feedback text
No description
7 replies
FFilament
Created by Sydd on 4/16/2024 in #❓┊help
Disable global search from topbar
Hi, all i new with Filament, and seriously enjoy it, at this moment I want disable / remove global search from panel. Please let me know how. Thks for answers.
10 replies