darcy1368
darcy1368
FFilament
Created by darcy1368 on 8/23/2024 in #❓┊help
Import action trigger job after import
I want to trigger a laravel job after an import action completes. There can be hundreds of rows imported at a time. I don't care if the import completes with or without errors, but I do need to trigger a job post import. That job processes all the rows imported as a group.
FYI - I thought of just triggering the job and using the Unique job trait to ensure only one is actually ran. However there must be a cleaner way to do this
5 replies
FFilament
Created by darcy1368 on 3/27/2024 in #❓┊help
custom field to render a mailable for preview
I want to create a custom form field to preview a markdown mailable associated to the current model I can preview the mailable in a seperate browser page or route but I cannot do it within a filament form. I was trying to use the ViewField to render it Any thoughts on how to deal with it.
2 replies
FFilament
Created by darcy1368 on 3/22/2024 in #❓┊help
Detect if view or edit page
I want to have a different view or hide controls based on if its an edit or view page. The scenario is that I have a builder on the edit to create an form On the view page I want see the rendered version only Struggling with how to accomplish this. Thoughts
5 replies
FFilament
Created by darcy1368 on 2/20/2024 in #❓┊help
LiveWire Redirect
I have a menuitem which invokes a livewire component. That component does some logic and redirects them back to the main dashboard. The redirect is not working, not sure what the issue is.
<?php

namespace App\Livewire;

use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Redirect;
use Livewire\Component;

class SwitchTeam extends Component
{
public $tenant;
public $team;
public function store() {
Log::info($this->tenant . " - " . $this->team);

}

public function render()
{

Log::info($this->tenant . " - " . $this->team);

// Other Logic ....

return $this->redirect(route('filament.app.pages.dashboard', ['tenant' => $this->tenant]));
}
}
<?php

namespace App\Livewire;

use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Redirect;
use Livewire\Component;

class SwitchTeam extends Component
{
public $tenant;
public $team;
public function store() {
Log::info($this->tenant . " - " . $this->team);

}

public function render()
{

Log::info($this->tenant . " - " . $this->team);

// Other Logic ....

return $this->redirect(route('filament.app.pages.dashboard', ['tenant' => $this->tenant]));
}
}
Not sure if there is a better way to invoke a livewire component or specific method from an MenuItem. Ultimately I need to invoke some logic from a menuitem. I believe this is a issue with redirects in the render method. However I am at a loss to understand the best way to accomplish this.
5 replies
FFilament
Created by darcy1368 on 1/31/2024 in #❓┊help
Custom Menu Action
I have a menu action which I want to do within SPA enabled - make a call to a livewire component - send a notification - load a page most likely the main dashboard I have some rudementary options using the controlers, but I can't get it to work with an SPA cleanly Any thoughts on how to approach this ?
2 replies
FFilament
Created by darcy1368 on 1/21/2024 in #❓┊help
AdminPanelProvider auth() returns null.
I am trying to dynamically build a tenant menu based on tenant configuration data. However that is based on what the current user is assigned in the org. However I cannot access the current user via the auth() provider. I am also having issues access the current TenantID. The only way I can seem to access the current user is with this code. Please note that this is just some mock code to determine
->tenantMenuItems([Org::getTenantMenuItems()])

static public function getTenantMenuItems(): array {

// THIS DOES NOT WORK, auth()->user() is null
$user = fn() => dd(auth()->user());
$user();

// THIS WORKS, but filament:Serving returns void
$user = Filament::serving(fn() => dd(Filament::getTenant()));

return [];
}
->tenantMenuItems([Org::getTenantMenuItems()])

static public function getTenantMenuItems(): array {

// THIS DOES NOT WORK, auth()->user() is null
$user = fn() => dd(auth()->user());
$user();

// THIS WORKS, but filament:Serving returns void
$user = Filament::serving(fn() => dd(Filament::getTenant()));

return [];
}
'
6 replies