Filament v2 - $this->record doesn't exist when using a simple resource
Title pretty much says it all, I'm exploring Filament v2 and trying to make a simple modal that creates a user, manipulates the password to be a random string, and then fires an email once saved. When I used this code on a normal resource, everything worked fine. However, when using a simple resource, I keep getting a "Property [$record] not found on component: [app.filament.resources.user-resource.pages.manage-users]" error.
The code in my
ManageUser.php
file is as follows:
I'm a bit lost as to what the issue is, have I missed a step, or misundertood something?Solution:Jump to solution
I think you can inject the
$record
parameter into after
:
```php
->after(function ($record) {
// ...
})...2 Replies
Solution
I think you can inject the
$record
parameter into after
:
Ahhhh that's it! I knew it would be simple, thank you @pboivin