MikeG
MikeG
FFilament
Created by MikeG on 5/23/2024 in #❓┊help
Desperately trying to fix gateway timeout on central filament panels
Hey Everyone! Im super stuck on an issue. For some reason both my central admin panels (multi-tenant through https://tenancyforlaravel.com/ are timeing out running on Vapor. I've added a middleware that should log something, but it's not logging anything. All routes on the panel are failing so it seems to not be something specific model related. I've been stuck on this for over 2 months now. I have 4 panels in total, 2 of them are in the tenant scope, and their working fine. It's the 2 on my central domain that are failing. I've tried everything I can think of. Their very basic panels with nothing added to them. Its working fine locally and on my dev server, but not on production. Does anyone have any debugging tips to fix this? Additional Info: - The login screen works, only after logging in this starts to fail - I've included the panel code in the commenets below
30 replies
FFilament
Created by MikeG on 4/22/2024 in #❓┊help
Laravel Echo failing on broadcast auth
Hey everyone, Running in to an issue with using laravel echo in a custom page through filament. The jist of it is that it's currently failing the /broadcast/auth call. I've added the following configuration to my BroadcastServiceProvider
Broadcast::routes(['middleware' => [InitializeTenancyByDomainOrSubdomain::class, Authenticate::class]]);
Broadcast::routes(['middleware' => [InitializeTenancyByDomainOrSubdomain::class, Authenticate::class]]);
The Authenticate::class is coming from Filament\Http\Middleware\Authenticate. This will result in a 302 redirect to login from the broadcasting auth endpoint. If I remove that entirely it will result in a 403 Forbidden. I've tried adding 'auth' to the middleware but this also results in 302 I'm assuming I'm doing something wrong here related to what authentication middleware I should be using but I'm not entirely sure Here is the code where I'm setting Echo:
window.Echo = new Echo({
broadcaster: 'pusher',
key: import.meta.env.VITE_PUSHER_APP_KEY,
cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER,
forceTLS: true,
});
window.Echo = new Echo({
broadcaster: 'pusher',
key: import.meta.env.VITE_PUSHER_APP_KEY,
cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER,
forceTLS: true,
});
It's connecting to Pusher properly, just failing the auth
9 replies
FFilament
Created by MikeG on 3/31/2024 in #❓┊help
Vapor timeout on 1 panel
Hey, I'm super stuck on an issue and can't seem to figure out what it is... I'm using laravel vapor, and I'm using filament for my entire project. I have multiple panels which all work, except for my central admin panel for managing everything. It used to be working but now suddenly (somehow) broke. After investigating, it seems Lambda is timing out the request
2024-03-31T15:44:44.402Z 49a7709a-4e3e-4127-ac0e-b9787df6c84b Task timed out after 60.06 seconds
2024-03-31T15:44:44.402Z 49a7709a-4e3e-4127-ac0e-b9787df6c84b Task timed out after 60.06 seconds
I havn't really changed anything on the central filament panel side of things, and it's happening to all routs associated with that panel. Even the Dashboard one which has no widgets or anything. I'll include the entire panel provider config below, any ideas on how to further debug this :/?
class CentralPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->id('central')
->path('central-admin')
->colors([
'primary' => Color::Amber,
])
->authGuard('admin')
->discoverResources(in: app_path('Filament/Central/Resources'), for: 'App\\Filament\\Central\\Resources')
->discoverPages(in: app_path('Filament/Central/Pages'), for: 'App\\Filament\\Central\\Pages')
->pages([
Pages\Dashboard::class,
])
->navigationItems([

NavigationItem::make('Vapor UI')
->url('/vapor-ui', shouldOpenInNewTab: true)
->group('System Tools')
->sort(1),

NavigationItem::make('Telescope')
->url('/telescope', shouldOpenInNewTab: true)
->group('System tools')
->sort(2),
])
->plugins([
BreezyCore::make()
->myProfile(
shouldRegisterUserMenu: true, // Sets the 'account' link in the panel User Menu (default = true)
shouldRegisterNavigation: true, // Adds a main navigation item for the My Profile page (default = false)
navigationGroup: 'Profile Settings', // Sets the navigation group for the My Profile page (default = null)
hasAvatars: false, // Enables the avatar upload form component (default = false)
slug: 'my-profile'
)
->enableTwoFactorAuthentication()
])
->login()
//->discoverWidgets(in: app_path('Filament/Central/Widgets'), for: 'App\\Filament\\Central\\Widgets')
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
]);
}
}
class CentralPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->id('central')
->path('central-admin')
->colors([
'primary' => Color::Amber,
])
->authGuard('admin')
->discoverResources(in: app_path('Filament/Central/Resources'), for: 'App\\Filament\\Central\\Resources')
->discoverPages(in: app_path('Filament/Central/Pages'), for: 'App\\Filament\\Central\\Pages')
->pages([
Pages\Dashboard::class,
])
->navigationItems([

NavigationItem::make('Vapor UI')
->url('/vapor-ui', shouldOpenInNewTab: true)
->group('System Tools')
->sort(1),

NavigationItem::make('Telescope')
->url('/telescope', shouldOpenInNewTab: true)
->group('System tools')
->sort(2),
])
->plugins([
BreezyCore::make()
->myProfile(
shouldRegisterUserMenu: true, // Sets the 'account' link in the panel User Menu (default = true)
shouldRegisterNavigation: true, // Adds a main navigation item for the My Profile page (default = false)
navigationGroup: 'Profile Settings', // Sets the navigation group for the My Profile page (default = null)
hasAvatars: false, // Enables the avatar upload form component (default = false)
slug: 'my-profile'
)
->enableTwoFactorAuthentication()
])
->login()
//->discoverWidgets(in: app_path('Filament/Central/Widgets'), for: 'App\\Filament\\Central\\Widgets')
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
]);
}
}
5 replies
FFilament
Created by MikeG on 2/2/2024 in #❓┊help
Calling a livewire PHP method from a custom field component
Hey, I have the need to call a PHP method from the view of a Customer Field Component. If I use $wire.methodName() it states the method doesnt exist on the livewire field component. What's happening is im getting a Javascript event which results in a code, with that code, i need to make an API call and set the state of the field to the result of that API call. Any way to do this?
7 replies
FFilament
Created by MikeG on 12/28/2023 in #❓┊help
Tenancy for laravel & File upload component
Hello, I'm running into an issue that I can't seem to figure out why it's happening. I use Tenancy for Laravel in my application for multi-tenant capabilities. I have a resource, with a form that contains a file upload. But for some reason, when trying to upload a file, I get the following error: base table or view not found: 1146 Table 'main_db.users' doesn't exist I'm confused about why it's trying to access the user's table, and even more so why it's using the central database main_db rather than the tenant's database. Does anyone know why this is happening?
40 replies
FFilament
Created by MikeG on 12/13/2023 in #❓┊help
Best practice working with JSON fields in model & Table Builder
Hello! Im trying to make a table widget, but im confused on how I can get values that live within a JSON column to be shown.. I have a JSON column called payload which for example contains {"foo": "bar", "example2": "value2"} How do I now have 2 columns in the table builder that are TextColumns which show the values from "foo" and "example2" ?
7 replies
FFilament
Created by MikeG on 11/5/2023 in #❓┊help
How do I pass form modal input back to the main form?
I am opening a form modal through an action, and having a new input field there. Upon saving the modal, i'd like that contents of the input field inside the modal to go back to the original input field the modal was opened from on the main form. How would one achieve that in Filament?
31 replies
FFilament
Created by MikeG on 11/4/2023 in #❓┊help
Making filament environment specific
I am completely new to Filament, and trying to learn how to use it for my own purpose. Which resources do I need to tap in to to understand how to make Filament work with the global scope of which "project" you have selected. Lets say there can be many "projects" you create through Filament. I guess the Project would be a filament-resource in this situation. Now you can select which project your currently working on, and only when you have a project selected, the resources appear on the navigation, all scoped to that project ID. Again, very new here, just looking for some guidance on which resources I need to learn more about to achieve that. I think I can make a dropdown box project selector based on one of the plugin's code but adapting it for my usecase (https://github.com/pxlrbt/filament-environment-indicator) Im confused on how to learn to get the rest of the above working
5 replies
FFilament
Created by MikeG on 11/4/2023 in #❓┊help
No styling on filament + Tenancy for Laravel
No description
17 replies