Skip to content

Commit

Permalink
Add impersonate to Filament.
Browse files Browse the repository at this point in the history
  • Loading branch information
timvandijck committed Apr 2, 2024
1 parent 48e6856 commit 8073fe3
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/Filament/Resources/Customers/UserResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Actions\Action;
use Filament\Tables\Actions\ActionGroup;
use Filament\Tables\Columns\ImageColumn;
use Filament\Tables\Table;
use STS\FilamentImpersonate\Tables\Actions\Impersonate;

class UserResource extends Resource
{
Expand Down Expand Up @@ -95,8 +97,9 @@ public static function table(Table $table): Table
//
])
->actions([
Impersonate::make(),
Tables\Actions\EditAction::make(),
ActionGroup::make([
Tables\Actions\EditAction::make(),
TransferPurchaseAssignmentAction::make(),
TransferPurchaseToUserAction::make(),
]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use App\Filament\Resources\Customers\UserResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;
use STS\FilamentImpersonate\Pages\Actions\Impersonate;

class EditUser extends EditRecord
{
Expand All @@ -14,6 +15,7 @@ protected function getHeaderActions(): array
{
return [
Actions\DeleteAction::make(),
Impersonate::make()->record($this->getRecord()),
];
}
}
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"spatie/ssh": "^1.8",
"spatie/test-time": "^1.3",
"spatie/valuestore": "^1.3.1",
"stechstudio/filament-impersonate": "^3.8",
"symfony/http-client": "^6.2",
"symfony/postmark-mailer": "^6.2",
"symfony/process": "^6.2",
Expand Down
111 changes: 110 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions resources/views/layout/default.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@

@include('layout.partials.footer')

<x-impersonate::banner/>

<livewire:scripts>
@stack('scripts')
<script>
Expand Down

0 comments on commit 8073fe3

Please sign in to comment.