TheRealTeeHill
TheRealTeeHill
FFilament
Created by TheRealTeeHill on 1/28/2025 in #❓┊help
Clear RichText input after action
Hi All, I have a table action to view details, the action opens modal which has a RichText input to update a related model, this is working fine. When I submit the form I need to clear/empty the RichText input... any ideas, Google and LLMs have not got me to a solution yet 😦
Tables\Actions\Action::make('viewDetails')
->slideOver()
->form([
RichEditor::make('response')
->name('response')
->label('')
->required()
->afterStateUpdated(fn($state) => session()->put('response', $state))
->visible(fn($record) => !TicketService::isTicketClosed($record)),
])
->label('Details')
->icon('heroicon-o-eye')
->modalHeading(fn($record) => "#$record->id: $record->name ({$record->status->name})")
->modalContent(fn($record) => view('filament.actions.view-ticket-description', [
'owner' => $record->user->name,
'subject' => $record->name,
'description' => $record->description,
'time' => $record->formattedDate,
'responses' => $record->responses()->with(['user', 'agent'])->get(),
'copiedUsers' => $record->copiedUsers()->get(),
'agents' => $record->agents()->with('user')->get(),
]))
->modalSubmitAction(false)
->extraModalFooterActions([
Action::make('sendResponse')
->label('Send')
->color('primary')
->action(function ($record) {
if (!TicketService::validateResponse()) return;
TicketService::createTicketResponse($record);
TicketService::sendNotification("Ticket updated", "Your response to ticket #$record->id was sent.");
})
->visible(fn($record) => !TicketService::isTicketClosed($record)),
])
->closeModalByClickingAway(false),
Tables\Actions\Action::make('viewDetails')
->slideOver()
->form([
RichEditor::make('response')
->name('response')
->label('')
->required()
->afterStateUpdated(fn($state) => session()->put('response', $state))
->visible(fn($record) => !TicketService::isTicketClosed($record)),
])
->label('Details')
->icon('heroicon-o-eye')
->modalHeading(fn($record) => "#$record->id: $record->name ({$record->status->name})")
->modalContent(fn($record) => view('filament.actions.view-ticket-description', [
'owner' => $record->user->name,
'subject' => $record->name,
'description' => $record->description,
'time' => $record->formattedDate,
'responses' => $record->responses()->with(['user', 'agent'])->get(),
'copiedUsers' => $record->copiedUsers()->get(),
'agents' => $record->agents()->with('user')->get(),
]))
->modalSubmitAction(false)
->extraModalFooterActions([
Action::make('sendResponse')
->label('Send')
->color('primary')
->action(function ($record) {
if (!TicketService::validateResponse()) return;
TicketService::createTicketResponse($record);
TicketService::sendNotification("Ticket updated", "Your response to ticket #$record->id was sent.");
})
->visible(fn($record) => !TicketService::isTicketClosed($record)),
])
->closeModalByClickingAway(false),
Cheers, Tee
9 replies
FFilament
Created by TheRealTeeHill on 1/22/2025 in #❓┊help
Dashboard widgets: drag and drop
Hi All, Is there a plugin or learning resources to configure a dashboard page to have the widgets be drag and drop by users to allow them to customise the dashboard widgets included and their layout/order? Cheers, Tee
9 replies
FFilament
Created by TheRealTeeHill on 1/15/2025 in #❓┊help
Dynamic Infolist heading
No description
2 replies
FFilament
Created by TheRealTeeHill on 1/15/2025 in #❓┊help
Is there a threads / conversation plugin?
No description
6 replies
FFilament
Created by TheRealTeeHill on 1/14/2025 in #❓┊help
Sorting resources within a cluster
No description
5 replies
FFilament
Created by TheRealTeeHill on 1/10/2025 in #❓┊help
Move "Save changes" button to sit between fields
Is it possible to render the form buttons "Save changes" and "Cancel" so they sit between 2 fields instead of bottom or top of form? I have my form which is made up of a text input, a code editor and a section that contains a fieldset which contains 3 checkbox lists. The check box lists are live so I'd like to put the save button before the section... any ideas? Cheers, Tee
12 replies
FFilament
Created by TheRealTeeHill on 1/10/2025 in #❓┊help
Displaying CheckboxList across multiple Fieldsets using relationship
I have Fleets, Vessels and RemoteScripts. A RemoteScript belongs to many Vessels via a pivot table, a Vessel belongs to a Fleet. When I do CheckboxList::make('vessels')->('vessels', 'name') it works and displays all the Vessels in the list, checking and unchecking boxes is reflected in the pivot table. But I would like to display each CheckboxList in a Fieldset for each Fleet. Between Google and GPT I have got this
...$fleets->map(function ($fleet) {
return Fieldset::make($fleet->name)
->schema([
CheckboxList::make("vessels_{$fleet->id}")
->options($fleet->vessels->pluck('name', 'id'))
->label(''),
])
->columnSpan(1);
})->toArray(),
...$fleets->map(function ($fleet) {
return Fieldset::make($fleet->name)
->schema([
CheckboxList::make("vessels_{$fleet->id}")
->options($fleet->vessels->pluck('name', 'id'))
->label(''),
])
->columnSpan(1);
})->toArray(),
This lists each CheckboxList in a Fieldset for each Fleet but the pivot table is not updating nor are the records in the pivot table reflected in the checkboxes. I have seen ->saveRelationshipsUsing(), is this something that will help resolve this issue? Cheers, Tee
5 replies
FFilament
Created by TheRealTeeHill on 9/28/2024 in #❓┊help
Why does my filter icon not look right?
No description
6 replies
FFilament
Created by TheRealTeeHill on 8/20/2024 in #❓┊help
Pass URL parameter from Page to Widget
I have a page that calls a widget
<?php

namespace App\Filament\Pages;

use App\Filament\Resources\VesselLocationResource\Widgets\VesselLocationGoogleMapWidget;
use Filament\Pages\Page;
use Illuminate\Http\Request;

class VesselFinder extends Page
{
public $fleet;

protected static ?string $navigationIcon = 'icon-map';

protected static ?string $navigationGroup = 'Maritime Overview';

protected static ?int $navigationSort = 5;

protected static string $view = 'filament.pages.vessel-finder';

public function mount(Request $request)
{
$this->fleet = $request->query('fleet');
}

protected function getHeaderWidgets(): array
{
return [
VesselLocationGoogleMapWidget::class,
];
}

protected function getHeaderWidgetsData(): array
{
return [
'fleet' => $this->fleet,
];
}
}
<?php

namespace App\Filament\Pages;

use App\Filament\Resources\VesselLocationResource\Widgets\VesselLocationGoogleMapWidget;
use Filament\Pages\Page;
use Illuminate\Http\Request;

class VesselFinder extends Page
{
public $fleet;

protected static ?string $navigationIcon = 'icon-map';

protected static ?string $navigationGroup = 'Maritime Overview';

protected static ?int $navigationSort = 5;

protected static string $view = 'filament.pages.vessel-finder';

public function mount(Request $request)
{
$this->fleet = $request->query('fleet');
}

protected function getHeaderWidgets(): array
{
return [
VesselLocationGoogleMapWidget::class,
];
}

protected function getHeaderWidgetsData(): array
{
return [
'fleet' => $this->fleet,
];
}
}
I want to pass a variable via the URL to the widget so I can filter the widget data - http://mysite.com/admin/vessel-finder?fleet=north How can I collect "fleet" in the VesselLocationGoogleMapWidget? Cheers
3 replies
FFilament
Created by TheRealTeeHill on 8/6/2024 in #❓┊help
Table Widget: hide the title / header
No description
7 replies
FFilament
Created by TheRealTeeHill on 7/30/2024 in #❓┊help
Minor layout issue
No description
13 replies
FFilament
Created by TheRealTeeHill on 7/29/2024 in #❓┊help
Use Filament Shield to manage access to Table Actions
Hi, I did some research and some GPT prompts but found nothing useful so far... Is it possible to block / allow access to Table Actions using Filament Shield? Or will it be better to use ->visible() Cheers, Tee
21 replies
FFilament
Created by TheRealTeeHill on 7/26/2024 in #❓┊help
Filament Shield and Filament Socialite login/register issue
No description
4 replies
FFilament
Created by TheRealTeeHill on 7/25/2024 in #❓┊help
Socialite, Microsoft, allowed domains issue...
No description
2 replies
FFilament
Created by TheRealTeeHill on 5/30/2024 in #❓┊help
Long email address in tooltip breaking at the @
No description
14 replies
FFilament
Created by TheRealTeeHill on 5/18/2024 in #❓┊help
Database Notifications not saving in table
My database notification that I want to make at the end of a console command is not saving, any ideas?
use Filament\Notifications\Notification;

// ...

Notification::make()
->title("New calls: $newCalls")
->sendToDatabase(User::find(1));
use Filament\Notifications\Notification;

// ...

Notification::make()
->title("New calls: $newCalls")
->sendToDatabase(User::find(1));
3 replies
FFilament
Created by TheRealTeeHill on 5/15/2024 in #❓┊help
Sortable() on One-of-Many column not sorting properly
No description
6 replies