Schilly
Schilly
FFilament
Created by vahnmarty on 7/15/2023 in #❓┊help
How to modify ToggleColumn function?
Danke!
7 replies
FFilament
Created by Schilly on 2/6/2024 in #❓┊help
Text Column Badge Color based on Pivot attribute
easy peasy 😛
100 replies
FFilament
Created by Schilly on 2/6/2024 in #❓┊help
Text Column Badge Color based on Pivot attribute
->orderBy('is_primary','desc')
->orderBy('is_primary','desc')
on the relationship(s)
100 replies
FFilament
Created by Schilly on 2/6/2024 in #❓┊help
Text Column Badge Color based on Pivot attribute
Lol! thanks
100 replies
FFilament
Created by Schilly on 2/6/2024 in #❓┊help
Text Column Badge Color based on Pivot attribute
Now if only the badges were ordered to have the primary show up first... 😛
100 replies
FFilament
Created by Schilly on 2/6/2024 in #❓┊help
Text Column Badge Color based on Pivot attribute
Same. Thanks man much appreciated 😄
100 replies
FFilament
Created by Schilly on 2/6/2024 in #❓┊help
Text Column Badge Color based on Pivot attribute
I need to work on my code refactoring thats for sure lol
100 replies
FFilament
Created by Schilly on 2/6/2024 in #❓┊help
Text Column Badge Color based on Pivot attribute
much cleaner lol
100 replies
FFilament
Created by Schilly on 2/6/2024 in #❓┊help
Text Column Badge Color based on Pivot attribute
Yes
100 replies
FFilament
Created by Schilly on 2/6/2024 in #❓┊help
Text Column Badge Color based on Pivot attribute
No description
100 replies
FFilament
Created by Schilly on 2/6/2024 in #❓┊help
Text Column Badge Color based on Pivot attribute
But now i get:
100 replies
FFilament
Created by Schilly on 2/6/2024 in #❓┊help
Text Column Badge Color based on Pivot attribute
as find is just a where on only the ID column
100 replies
FFilament
Created by Schilly on 2/6/2024 in #❓┊help
Text Column Badge Color based on Pivot attribute
not that should make a difference
100 replies
FFilament
Created by Schilly on 2/6/2024 in #❓┊help
Text Column Badge Color based on Pivot attribute
and also used a where isntead of find()
100 replies
FFilament
Created by Schilly on 2/6/2024 in #❓┊help
Text Column Badge Color based on Pivot attribute
yea
100 replies
FFilament
Created by Schilly on 2/6/2024 in #❓┊help
Text Column Badge Color based on Pivot attribute
Tables\Columns\TextColumn::make('squadrons.id')
->label('Squadron(s)')
->formatStateUsing(fn (string $state, $record): string => $record->squadrons->find($state)->abbrv)
->badge()
->color(
function(string $state, $record) {
$target = $record->squadrons->find($state);

if($target->pivot->is_primary == '1') {
return 'success';
}
}
),
Tables\Columns\TextColumn::make('squadrons.id')
->label('Squadron(s)')
->formatStateUsing(fn (string $state, $record): string => $record->squadrons->find($state)->abbrv)
->badge()
->color(
function(string $state, $record) {
$target = $record->squadrons->find($state);

if($target->pivot->is_primary == '1') {
return 'success';
}
}
),
100 replies
FFilament
Created by Schilly on 2/6/2024 in #❓┊help
Text Column Badge Color based on Pivot attribute
figured it out!
100 replies
FFilament
Created by Schilly on 2/6/2024 in #❓┊help
Text Column Badge Color based on Pivot attribute
AHAH!
100 replies
FFilament
Created by Schilly on 2/6/2024 in #❓┊help
Text Column Badge Color based on Pivot attribute
Thanks for tryin tho @CodeWithDennis much appreciated
100 replies
FFilament
Created by Schilly on 2/6/2024 in #❓┊help
Text Column Badge Color based on Pivot attribute
Halp! Im Lost! lol
100 replies