Fossil
2FA Middleware
I use Filament as the admin panel for my app. Whenever I login to my app, I get a 2FA screen after clicking login and the rest of the apps routes are not working before 2FA is completed.
Now when I don't enter my 2FA, and try to open my Filament route instead I get the actual dashboard and everything is working. I can delete users etc.
IE: Security hole.
How can I apply my 2FA Middleware? Whenever I add
\App\Http\Middleware\Google2FAMiddleware::class
to the middleware()
or authMiddleware()
methods on my public function panel(Panel $panel): Panel
in AdminPanelProvider.php it doesn't change anything.22 replies
Value not updated when clicking save
I have a column called
videos_id
in my table. And a videos table where that ID is the primary key id
and a column called title
. In this dropdown on the Filament Edit page I want to show the title and not the ID. So I am doing this:
Which works fine. But when I change the value and click Save. The old ID is still present on the row.
Devtools show a POST request to /livewire/update
with JSON data which does contain the NEW id. So I am puzzled why this happens.
Removed all the other data from the JSON to make it readable.7 replies
On/off toggle based on relationship? (Spatie/Laravel Permission)
I have this toggle to on/off certain permissions on the Edit User resource. How do I make that work with permissions stored in another table using Laravel Permission by Spatie?
Basically a name in the permissions table could be
'view this'
with id = 9
for example. I need t check if it exists for this userID and turn the toggle on/off based on that.
If exists and I turn off the toggle it should delete and vice versa.4 replies
Custom delete logic?
My app requires some files on disk to be delete when a model is deleted. I have a function in the model that handles this plus the row deletion in DB itself.
Any way I could make the delete and bulk delete functions in Filament call this code instead of just removing the record from the DB?
3 replies
Header action modal to search API, how to show results properly?
So I have a header action which opens a modal. The modal houses a form field which allows you to search an external API. I process the results in the
->action(function (array $data) {}
method.
Now I want to loop over the results and build a nice HTML table or something so a user can pick a result. However I when I do var_dump($data); I get nothing. When I do dd($data) I see my data in a black dd() screen of course so it's there.
Any way of presenting this data to this or another modal and fire some PHP code when a user clicks a result?
28 replies