Skip to content
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

Support for page action #7

Closed
jszobody opened this issue Jan 20, 2022 · 2 comments
Closed

Support for page action #7

jszobody opened this issue Jan 20, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@jszobody
Copy link
Member

Right now this is only available as a table action. Would be nice to be available as a page action as well, so it could be added to a View User page, for example.

@jszobody jszobody added the enhancement New feature or request label Jan 20, 2022
@jacksleight
Copy link

This would be really useful. It would also be nice to have the option to use a regular text button instead of an icon.

If anyone needs this immediately you can do this for now:

use STS\FilamentImpersonate\Impersonate;

class ViewUser extends ViewRecord
{
    // ...

    protected function getActions(): array
    {
        return array_merge([
            Pages\Actions\ButtonAction::make('impersonate')
                ->action(function () {
                    Impersonate::impersonate($this->record);
                }),
        ], parent::getActions());
    }
}

@josefbehr
Copy link
Contributor

@jszobody I just added this in #27, please test, if you can

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants