toeknee
toeknee
FFilament
Created by andika on 11/18/2024 in #❓┊help
login route
But filament natively has throttling on login anyway, so brute forcing which Wordpress allows isn't allowed here 🙂
8 replies
FFilament
Created by MZX on 11/18/2024 in #❓┊help
Anyone implemented SAML in a Filament app?
9 replies
FFilament
Created by MZX on 11/18/2024 in #❓┊help
Anyone implemented SAML in a Filament app?
It's more laravel than filament, we have an auth login class, just override it and handle the logic with your SAML
9 replies
FFilament
Created by ollieread on 11/18/2024 in #❓┊help
Ability to find a panel programmatically
It depends what settings you want to change? I use this method to get the panels, then the panels that are accessible filtering.
ublic function panels(): array
{
$panels = FilamentFacade::getPanels();

// Remove non accessible panels
foreach ($panels as $k => $panel) {
if (! $this->canAccessPanel($panel)) {
unset($panels[$k]);
}
}

return $panels;
}
ublic function panels(): array
{
$panels = FilamentFacade::getPanels();

// Remove non accessible panels
foreach ($panels as $k => $panel) {
if (! $this->canAccessPanel($panel)) {
unset($panels[$k]);
}
}

return $panels;
}
3 replies
FFilament
Created by andika on 11/18/2024 in #❓┊help
login route
They can... but you can just change you panel name there is no need to hide anything. Just make it unique if you want it to be.
8 replies
FFilament
Created by andika on 11/18/2024 in #❓┊help
login route
@Dennis Koch it's Security by obsecurity
8 replies
FFilament
Created by toeknee on 7/12/2024 in #❓┊help
Form to PDF
Sorry, I just used DomPDF and did it on an action, rendering a blade. i.e.
$filepath = 'pdfs/my_view';
$filename = $record->name . '_' .now() . '.pdf';
$pdf = Pdf::loadView('pdf.my_view', [
'record' => $record,
]);
$pdf->render();
$canvas = $pdf->getDomPDF()->getCanvas();
$canvas->page_script(function ($pageNumber, $pageCount, $canvas, $fontMetrics) {
// Text to display
$text = "Page $pageNumber of $pageCount";
// Margins from the bottom right
$marginRight = 10;
$marginBottom = 20;
// Font and font size
$fontSize = 10;
$font = $fontMetrics->getFont('Helvetica');
// Set position
$textWidth = $fontMetrics->getTextWidth($text, $font, $fontSize);
$xPosition = $canvas->get_width() - $textWidth - $marginRight;
$yPosition = $canvas->get_height() - $marginBottom;
// Draw text
$canvas->text($xPosition, $yPosition, $text, $font, $fontSize);
});

$pdf->save(
$filepath.$filename, 's3'
);
return response()->streamDownload(function () use ($file) {
echo $file;
}, $filename);
$filepath = 'pdfs/my_view';
$filename = $record->name . '_' .now() . '.pdf';
$pdf = Pdf::loadView('pdf.my_view', [
'record' => $record,
]);
$pdf->render();
$canvas = $pdf->getDomPDF()->getCanvas();
$canvas->page_script(function ($pageNumber, $pageCount, $canvas, $fontMetrics) {
// Text to display
$text = "Page $pageNumber of $pageCount";
// Margins from the bottom right
$marginRight = 10;
$marginBottom = 20;
// Font and font size
$fontSize = 10;
$font = $fontMetrics->getFont('Helvetica');
// Set position
$textWidth = $fontMetrics->getTextWidth($text, $font, $fontSize);
$xPosition = $canvas->get_width() - $textWidth - $marginRight;
$yPosition = $canvas->get_height() - $marginBottom;
// Draw text
$canvas->text($xPosition, $yPosition, $text, $font, $fontSize);
});

$pdf->save(
$filepath.$filename, 's3'
);
return response()->streamDownload(function () use ($file) {
echo $file;
}, $filename);
10 replies
FFilament
Created by toeknee on 7/12/2024 in #❓┊help
Form to PDF
Not really I built a custom quick render
10 replies
FFilament
Created by Mauricio G on 11/14/2024 in #❓┊help
Filament Sidebar Menu Search
So to do what you want, you'll need to dig deep in with some JS or use alpine and override the filament menu and use data attributes to filter the items.
15 replies
FFilament
Created by Mauricio G on 11/14/2024 in #❓┊help
Filament Sidebar Menu Search
Just render the blade with the render hook
15 replies
FFilament
Created by Mauricio G on 11/14/2024 in #❓┊help
Filament Sidebar Menu Search
Noo...
15 replies
FFilament
Created by Mauricio G on 11/14/2024 in #❓┊help
Filament Sidebar Menu Search
Look at simple Livewire components with a search input?
15 replies
FFilament
Created by Mauricio G on 11/14/2024 in #❓┊help
Filament Sidebar Menu Search
Nope. You could do this though by adding a quick search and loading the menu items exactly as the navigation menu builds them and filter by search and on click redirect to X
15 replies
FFilament
Created by chris.mccabe on 11/13/2024 in #❓┊help
Relation manager pulls wrong data
I beleive the above is then right
17 replies
FFilament
Created by chris.mccabe on 11/13/2024 in #❓┊help
Relation manager pulls wrong data
])->modifyQueryUsing(function (Builder $query) {
$appointmentId = $this->ownerRecord->id;
$patientId = $this->ownerRecord->patient_id;

return $query->where(function ($query) use ($appointmentId) {
$query->where('appointment_id', '>', 0)
->orWhereNull('appointment_id');
})->where('patient_id', $patientId);
});
])->modifyQueryUsing(function (Builder $query) {
$appointmentId = $this->ownerRecord->id;
$patientId = $this->ownerRecord->patient_id;

return $query->where(function ($query) use ($appointmentId) {
$query->where('appointment_id', '>', 0)
->orWhereNull('appointment_id');
})->where('patient_id', $patientId);
});
That limits it to the appointment_id still.... but also null values change it to the above.
17 replies
FFilament
Created by chris.mccabe on 11/13/2024 in #❓┊help
Relation manager pulls wrong data
I am fairly sure you can, I haven't checked though. But adding ->modifyQueryUsing(fn(Builder $query) => $query->where('appointment_id', '>', 1)) To the relation manager table means it will find all above the id of 1 which basically means the id doesn't matter.
17 replies
FFilament
Created by Pritbor on 11/14/2024 in #❓┊help
UserMenuItem with User Tenant Switch Option
Render the view in both places.
5 replies
FFilament
Created by chris.mccabe on 11/13/2024 in #❓┊help
Relation manager pulls wrong data
On the $table instance in the source ->modifyQueryUsing(fn(Builder $query) => $query->where('appointment_id', '>', 1))
17 replies