-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trouble on impersonate from resources other than UserResource #74
Comments
If you look at the table action...
... you can see how the current
This is untested, but it seems like this sort of approach should work. I think you just need to manually handle the action, and tell the impersonate method where the actual user model is. |
I am having the same issue. Tried to override the record method but did not work as well |
@z4yed This should work: ->actions([
Impersonate::make()
->action(fn(Interpreter $record, Impersonate $action) => $action->impersonate($record->user)),
Tables\Actions\EditAction::make(),
]) |
I have a resource named
InstructorResource
. TheInstructor
model has a relationaluser
method which belongs toUser
model.I am trying to impersonate from InstructorResource by:
From the
UserResource
class, it is working perfectly though. Is it possible to impersonate fromInstructResource
?The text was updated successfully, but these errors were encountered: