pocket.racer
pocket.racer
FFilament
Created by pocket.racer on 6/20/2024 in #❓┊help
Code in resources/bootstrap.js not running
So i have the following code in my resources/bootstrap.js but my sentry user feedback widget didn't show up on Filament pages, but it shows up on non filament pages. If anyone know what i missed out on let me know
import * as Sentry from "@sentry/browser";

Sentry.init({
dsn: import.meta.env.VITE_SENTRY_DSN_PUBLIC,
integrations: [
Sentry.feedbackIntegration({
colorScheme: 'system',
showBranding: false,
}),
Sentry.replayIntegration(),
],
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
tracePropagationTargets: [
'my-site.com',
],
});
import * as Sentry from "@sentry/browser";

Sentry.init({
dsn: import.meta.env.VITE_SENTRY_DSN_PUBLIC,
integrations: [
Sentry.feedbackIntegration({
colorScheme: 'system',
showBranding: false,
}),
Sentry.replayIntegration(),
],
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
tracePropagationTargets: [
'my-site.com',
],
});
2 replies
FFilament
Created by pocket.racer on 6/12/2024 in #❓┊help
How to resolve php artisan filament:cache-components error?
I added this command to my production deployment script as recommended. But I keep get this error during deployment crc32(): Passing null to parameter #1 ($string) of type string is deprecated in /home/forge/my-site.com/releases/20240612042953/vendor/livewire/livewire/src/Features/SupportScriptsAndAssets/SupportScriptsAndAssets.php on line 31 When I check that class in livewire package. it is this line
$viewPath = crc32(app('blade.compiler')->getPath());
$viewPath = crc32(app('blade.compiler')->getPath());
It seem that calling ->getPath() on app('blade.compiler') always return null What can I do so that app('blade.compiler')->getPath() will return a string?
2 replies
FFilament
Created by pocket.racer on 2/28/2024 in #❓┊help
How to stop the navigation sidebar from appearing right after login on mobile?
No description
17 replies
FFilament
Created by pocket.racer on 1/24/2024 in #❓┊help
How to add render hook to modal & slideover?
Hi, I am trying to add something to modal & slideover render hook in filament tables & table widget. But when I look at the documentation I don't know which is the right one https://filamentphp.com/docs/3.x/support/render-hooks Hope someone could help. Thank you
2 replies
FFilament
Created by pocket.racer on 1/17/2024 in #❓┊help
Custom page form showing as $this->form
No description
16 replies
FFilament
Created by pocket.racer on 1/17/2024 in #❓┊help
How to get unsaved changes alerts to work for custom pages?
it work for my resource pages but doesn't work for my custom page form
3 replies
FFilament
Created by pocket.racer on 12/19/2023 in #❓┊help
Viewing table record details in a table modal show another record details? (Security)
Have this really weird bug that happen only in production My filament v3 table has many rows and for a particular user, when he press the 'View Details' action on the table row, it shows another record details (sometimes) This seem to only happen for that particular user and we have been unable to reproduce it anywhere & that is worryingly as it's a potential security risk (or maybe not since it's still a record the person is allowed to see i think, just that the it's a different record displayed). Hence wanted to ask if anybody else faced a similar issue too and if u all manage to find out what might be the reasons Part of us wonder if it is a diffing bug or something else
4 replies
FFilament
Created by pocket.racer on 11/29/2023 in #❓┊help
DateTimePicker fields ->seconds(false) no longer working after update to 3.0.103 & 3.1
But it work in 3.0.102 (downgraded and confirmed it) Looking at the release notes, I can't tell which PR is it that broke it. Since none of the PRs mention about Dates https://github.com/filamentphp/filament/releases The in 3.0.103 DateTimePicker field still show but when submit will get a browser validation error like this
13 replies
FFilament
Created by pocket.racer on 11/10/2023 in #❓┊help
how to display sort selections with Table ViewColumn?
No description
13 replies
FFilament
Created by pocket.racer on 10/5/2023 in #❓┊help
how to group by salary range with filament table
I have a requirement to group by annual salary my users table have a monthly_salary column I want to do a filament table grouping that will group the users to the following group annual salary < 50000 annual salary < 80000 annual salary >= 80000 But not quite sure how to do it. So far I did the following
public function table(Table $table): Table
{
return $table
->groups([
Group::make('montly_salary')
->label('Annual Salary')
->titlePrefixedWithLabel(false)
->getTitleFromRecordUsing(function (User $record): string {
if ($record->monthly_salary * 12 < 50_000) {
return '< 50,000';
}

if ($record->monthly_salary * 12 < 80_000) {
return '50,000 to < 80,000';
}

return '$80,000 and above';
})
->getKeyFromRecordUsing(function (ListedLoanApplication $record): string {
if ($record->monthly_salary * 12 < 50_000) {
return '< 50,000';
}

if ($record->monthly_salary * 12 < 80_000) {
return '50,000 to < 80,000';
}

return '$80,000 and above';
}),
]);
}
public function table(Table $table): Table
{
return $table
->groups([
Group::make('montly_salary')
->label('Annual Salary')
->titlePrefixedWithLabel(false)
->getTitleFromRecordUsing(function (User $record): string {
if ($record->monthly_salary * 12 < 50_000) {
return '< 50,000';
}

if ($record->monthly_salary * 12 < 80_000) {
return '50,000 to < 80,000';
}

return '$80,000 and above';
})
->getKeyFromRecordUsing(function (ListedLoanApplication $record): string {
if ($record->monthly_salary * 12 < 50_000) {
return '< 50,000';
}

if ($record->monthly_salary * 12 < 80_000) {
return '50,000 to < 80,000';
}

return '$80,000 and above';
}),
]);
}
However it doesn't work, i figured i prob need to use ->groupQueryUsing() but not quire sure how do i write the query code since this is not a simple group by status https://filamentphp.com/docs/3.x/tables/grouping Thank you
3 replies
FFilament
Created by pocket.racer on 10/2/2023 in #❓┊help
how to center infolist entry?
My image keep appear at the left instead of at the center my code which you can see I used ->alignCenter() but it doesn't work (alignCenter() wasn't mentioned in the docs, but the docs didn't mention how to center infolist entries either)
ImageEntry::make('page_logo_image')
->label('')
->columnSpanFull()
->alignCenter()
->defaultImageUrl(url('/images/icons/page-1-logo.png')),
ImageEntry::make('page_logo_image')
->label('')
->columnSpanFull()
->alignCenter()
->defaultImageUrl(url('/images/icons/page-1-logo.png')),
I plan to have a few other text entries centered too. and some of the left. I have also tried to remove ->columnSpanFull() but it didn't work, the image still appear at the left
5 replies
FFilament
Created by pocket.racer on 9/28/2023 in #❓┊help
How to remove 2nd y axis in charts?
No description
2 replies
FFilament
Created by pocket.racer on 9/27/2023 in #❓┊help
How to do IconColumn with reverse boolean?
Usually when I want do do an IconColumn with boolean i just do this
IconColumn::make('is_human_at')
->boolean()
IconColumn::make('is_human_at')
->boolean()
However i have a column that need the reverse so I tried to do this
IconColumn::make('is_human_at')
->label('is_robot')
->icons([
'heroicon-o-check-circle' => fn (?string $state): bool => $state !== null,
'heroicon-o-x-circle' => fn (?string $state): bool => $state !== null,
])
->colors([
'success' => fn (?string $state): bool => $state !== null,
'danger' => fn (?string $state): bool => $state !== null,
]),
IconColumn::make('is_human_at')
->label('is_robot')
->icons([
'heroicon-o-check-circle' => fn (?string $state): bool => $state !== null,
'heroicon-o-x-circle' => fn (?string $state): bool => $state !== null,
])
->colors([
'success' => fn (?string $state): bool => $state !== null,
'danger' => fn (?string $state): bool => $state !== null,
]),
However for the 2nd one, only the danger red shows, when it is supposed to be green it does not show at all
23 replies
FFilament
Created by pocket.racer on 9/25/2023 in #❓┊help
how to make panel resource edit page save button to be sticky like v2?
In v2 there is a simple config to change in config/filament.php to make edit resource page save button sticky
'forms' => [
'actions' => [
'alignment' => 'left',
'are_sticky' => true,
],
'have_inline_labels' => false,
],
'forms' => [
'actions' => [
'alignment' => 'left',
'are_sticky' => true,
],
'have_inline_labels' => false,
],
in v3 what is the equivalent? I can't find it in the documentation
10 replies
FFilament
Created by pocket.racer on 9/24/2023 in #❓┊help
how to info list text url to external site?
Hi, i'm having problem with this. My code is like this
TextEntry::make('address')

->url(function (string $state): string {
return urlencode('https://www.google.com/maps/dir/?api=1&query="' . $state . '"');
})
->openUrlInNewTab()
->copyable()
->columnSpanFull(),
TextEntry::make('address')

->url(function (string $state): string {
return urlencode('https://www.google.com/maps/dir/?api=1&query="' . $state . '"');
})
->openUrlInNewTab()
->copyable()
->columnSpanFull(),
However the url is 'https://www.my-site-domain.com/https://www.google.com/maps/dir/?api=1&query= ...' How do i get it to not prepend my site domain?
3 replies
FFilament
Created by pocket.racer on 9/15/2023 in #❓┊help
What replace HasRelationshipTable in v3?
In v2 i have this piece of code in many of my relationship manager classes
->headerActions([
CreateAction::make()
->using(fn (HasRelationshipTable $livewire, array $data): Model => $livewire
->getRelationship()
->create($data)),
]);
->headerActions([
CreateAction::make()
->using(fn (HasRelationshipTable $livewire, array $data): Model => $livewire
->getRelationship()
->create($data)),
]);
But in v3 i get HasRelationshipTable doesn't exist errors. So what is the new way of doing it? I checked the documentation but couldn't figure it out Thank you
3 replies
FFilament
Created by pocket.racer on 9/14/2023 in #❓┊help
How to position header actions at center instead of right side?
How to position header action button at center instead of right side? When it is at center, it is harder to be missed by mobile users of our site (did a test last time before moving to filament), so want to be able to position it at center above the table instead of default right side above the table
3 replies
FFilament
Created by pocket.racer on 9/9/2023 in #❓┊help
Table action modal not showing up on 1st click
No description
22 replies
FFilament
Created by pocket.racer on 9/7/2023 in #❓┊help
How to increase Register Page White box width?
I tried the following: - subclass Register and add protected ?string $maxContentWidth = 'full'; Then use my Register class in the Panel registration - override the register blade view and do (added a w-full class)
<x-filament-panels::page.simple class="w-full">
<x-filament-panels::page.simple class="w-full">
But the register page white box width is still the same
11 replies
FFilament
Created by pocket.racer on 9/5/2023 in #❓┊help
Anyone have intermittent server errors using filament v3 on laravel vapor?
Like sometimes it happen on a filament v3 page, then i refresh, it goes away then i refresh it happens again, then go away for a while then happens again. Not in the middle of any deployment. Just want to get a confirmation if anyone else face similar issues?
2 replies