Git Product home page Git Product logo

filament-impersonate's People

Contributors

arjendejong12 avatar bogardo avatar charathan avatar cntabana avatar corean avatar danharrin avatar eliaszobody avatar gergo85 avatar iantasker avatar intrepidws avatar jamesdb avatar josefbehr avatar jszobody avatar juliomotol avatar lamberttraccard avatar lloricode avatar matthans0n avatar mohamedsabil83 avatar nestecha avatar oddvalue avatar pxlrbt avatar rapkis avatar ruswan avatar v13axel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

filament-impersonate's Issues

Multi Guard issue.

using this package with two guards "web" (those my website users) and "admins" (filament users)
and added this package to both.
the problem is when impersonating "web", it works well.
but when trying to impersonate "admins" guard, it just picks the same id in guard "web"

lost? me too 😂.

so in admins table

  • id (1) admin1
  • id (2) admin2

and in users table

  • id (1) user1
  • id (2) user2

when i click impersonate on admin2, it impersonate user2 instead.

auth.php

    'guards' => [
        'web' => [
            'driver' => 'session',
            'provider' => 'clients',
        ],

        'admins' => [
            'driver' => 'session',
            'provider' => 'admins',
        ],
    ],

Formatting of Action in a group doesn't match other Actions

When adding the impersonate Action to a Group like so:

            ->actions([
                ActionGroup::make([
                    ViewAction::make(),
                    EditAction::make(),
                    DeleteAction::make(),
                    Impersonate::make()->redirectTo('/admin'),
                ]),
            ]);

the styling isn't the same, nor does the label appear:
image

image

Is this caused by my incorrect usage of the plugin or is it a bug?

Error on redirect FilamentManager::getUserName()

When redirect I'm getting this error:

Filament\FilamentManager::getUserName(): Argument #1 ($user) must be of type Illuminate\Database\Eloquent\Model|Illuminate\Contracts\Auth\Authenticatable, null given, called in /Users/daniel/Desktop/Proyectos/tickify/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 353

<x-filament-impersonate::banner/>

Enable to show banner

I have an issue to display the banner . I have investigated the code. I found that the issue lies in the following file:

https://github.com/stechstudio/filament-impersonate/blob/master/src/FilamentImpersonateServiceProvider.php#L37

In the original code snippet, the Filament::registerRenderHook method is used as follows:

Filament::registerRenderHook(
            'body.start',
            static fn (): string => Blade::render("<x-filament-impersonate::banner/>")
);

To resolve the issue, you can change it to the following code:

FilamentView::registerRenderHook(
            'panels::body.start',
            static fn (): string => Blade::render("<x-filament-impersonate::banner/>")
);

If you're okay with it, I can create a pull request to implement the changes.

Let me know what you think.

By the way, thank you for your plugin

Cause gap on Filament Sidebar

https://github.com/stechstudio/filament-impersonate/blob/ee92ce42de52561aaf6731390b92846329f58b13/resources/views/components/banner.blade.php#L37C4-L39

    div.fi-layout > aside.fi-sidebar {
        padding-{{ $position }}: var(--impersonate-banner-height);
    }

This line of code cause an issues with the filament sidebar, it create a gap between the sidebar and the impersonate banner.

I'm using the default setup/configuration of the plugin.

image


Disabling the Css it fixed the issue or if the position setting is top then the css will not be applied.

image
image

Crashing when leaving impersonate

Hello, I'm a new Filament user so please excuse me if this is actually entirely my fault!

I've followed the steps to install the package and it works great, except that when I click on the "Leave" button on the banner, the app crashes with the following error.

Symfony\Component\HttpFoundation\Response::setContent(): Argument #1 ($content) must be of type ?string, Illuminate\Routing\Redirector given, called in /var/www/html/vendor/laravel/framework/src/Illuminate/Http/Response.php on line 72
I tried setting a different redirect with the backTo() method, and through the .env file but neither worked.

Any idea why this might be happening?

Thanks!

Trapped in exception when impersonating soft-deleted user

I attempted to impersonate a soft-deleted user, which ends up trapping me in the following exception:

Filament\FilamentManager::getUserName(): Argument #1 ($user) must be of type Illuminate\Database\Eloquent\Model|Illuminate\Contracts\Auth\Authenticatable, null given

in reference to

<x-filament-impersonate::banner/>

I understand why this is probably happening; the intended $user is not being hydrated ->withTrashed() applied. Where exactly do I go to customize the banner, given that in the current version, it is being injected via a render hook? i.e., I did not place x-impersonate::banner into my master layout.

Temporary solution to break out of the exception was to set FILAMENT_IMPERSONATE_BANNER_RENDER_HOOK="" in .env so that I could log back in.

Trouble on impersonate from resources other than UserResource

I have a resource named InstructorResource. The Instructor model has a relational user method which belongs to User model.

I am trying to impersonate from InstructorResource by:

return $table
       ->actions([
                Impersonate::make()
                    ->redirectTo('/instructor'),

                Tables\Actions\ViewAction::make(),
                Tables\Actions\EditAction::make(),
            ]),

From the UserResource class, it is working perfectly though. Is it possible to impersonate from InstructResource?

Error on impersionate

Hey guys.

I have the following error when clicking the button to impersonate

Call to undefined method Filament\FilamentManager::getCurrentPanel()

Has anyone ever get this problem?

Captura de Tela 2023-10-05 às 07 27 14

Problem to impersonate with admin guard

image

I have two guards, admin and the default web. When I'm trying to impersonate an admin as a default user, I'm getting this issue.

What I'm doing wrong? If you need more information, please, let me know, and I'll share you what you need.

Thanks in advance!

Laravel 9 support?

Is it possible to add Laravel 9 support?

lab404/laravel-impersonate needs to be bumped up?

Thank you!

Table Impersonate does not work with widgets

Hello,

If you have a table in which there are widgets that interact with the table(InteractsWithPageTable ) when executing the impersonate action another widget event is sent, which causes that the user is not redirected correctly.

Do you know any way to stop this from happening?

Best regards

error filamentManager::getCurrentPanel()

Get this error message when I try to impersonate a user.

Call to undefined method Filament\FilamentManager::getCurrentPanel() - Using jetstream. Livewire 2 - any idea?

Undefined type 'App\Models\IsFilamentUser'.

In the doc it says use IsFilamentUser, but I get the message Undefined type 'App\Models\IsFilamentUser'. and it can't find anything to import. It seems to work without IsFilamentUser, but am I doing anything wrong or is the example wrong?

class User implements FilamentUser {
    use IsFilamentUser;
    
    public function canImpersonate()
    {
        return true;
    }
}

Not working when using laravel octane

It seems that this plugin isn't working properly with Laravel Octane (https://laravel.com/docs/10.x/octane).

I have an existing project where I use your plugin since you released it. Now we switched to laravel Octane (with roadrunner) on Production, and a user still can impersonate, but the top bar to end the Impersonate isn't displayed.

I can reproduce this on local system as well. I login+impersonate:

  • Using my local Apache with php-fpm or php artisan serve everything works as expected.
  • Using php artisan octane:start every thing works, except I cant see the impersonate bar.

Any ideas? Does this package use any static class properties or something? See https://laravel.com/docs/10.x/octane#dependency-injection-and-octane

Btw: Thanks for your great package!

Impersonate stopped working after Laravel update?

Impersonate stopped working after I updated Laravel. I was on Laravel 9.3.1 and it worked and after updating to 9.6.0 I just get logged out when I click on the impersonate button. Any ideas why? Impersonate, Filament and Jetstream are all on latest versions.

I found two things that seems to "fix" this. One is removing this line from App\Http\Kernel.php ... \Laravel\Jetstream\Http\Middleware\AuthenticateSession::class, and the other is changing Route::middleware(['auth:sanctum', 'verified']) to Route::middleware(['auth:web', 'verified']) in my routes file. Does anyone know the implications of doing any of those options?

Thank you!

Banner hidden by my navbar

I have a navbar on the page that is fixed to the top. When impersonating someone, the impersonate::banner is also fixed to the top and behind the navbar. How can I make it appear below my navbar?

I tried assigning a style of top: 60px;, but that didn't work.

Thanks!

Support for page action

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.

Localize Banner Strings.

can we customize the banner to text?
to support othe languages.
like in arabic it should be

{
"leave": "انهاء",
"Impersonating user": "انتحال شخصية المستخدم",
}

BTW: not very sure of the Arabic translations, but you got the point right ?

image

image

Dark/Light mode

Hi,

Many thanks for this package. It would be great if the banner style automatically switches when filament dark mode is enabled and toggled.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.