Skip to content

Commit 51325de

Browse files
committed
refactor: remove Filament Shield plugin
1 parent d5dfa8e commit 51325de

6 files changed

Lines changed: 1 addition & 48 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ This package contains all common non-opinionated code that is used in our Eclips
1414
## Requirements
1515
- PHP 8.2
1616
- Filament 4
17-
- Filament Shield plugin (to manage permissions)
1817
- Laravel Scout
1918

2019
See [composer.json](composer.json) for details.

composer.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"require": {
4242
"php": "^8.3",
4343
"ext-intl": "*",
44-
"bezhansalleh/filament-shield": "^4.0",
4544
"datalinx/php-utils": "^2.5",
4645
"filament/filament": "^5.0",
4746
"filament/spatie-laravel-settings-plugin": "^5.0",
@@ -72,8 +71,6 @@
7271
"@php vendor/bin/testbench serve --ansi"
7372
],
7473
"setup": [
75-
"@php vendor/bin/testbench vendor:publish --provider='Spatie\\Permission\\PermissionServiceProvider'",
76-
"@php vendor/bin/testbench vendor:publish --tag='filament-shield-config'",
7774
"@php vendor/bin/testbench package:sync-skeleton"
7875
]
7976
},

tests/Pest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@
1717

1818
uses(TestCase::class)
1919
->use(RefreshDatabase::class)
20-
->beforeEach(function () {
21-
// Seed roles and permissions with Filament Shield plugin
22-
Artisan::call('shield:generate', [
23-
'--all' => null,
24-
'--panel' => 'admin',
25-
'--option' => 'permissions',
26-
]);
27-
})
2820
->in(__DIR__);
2921

3022
/*

tests/TestCase.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,11 @@
44

55
use Orchestra\Testbench\Concerns\WithWorkbench;
66
use Orchestra\Testbench\TestCase as BaseTestCase;
7-
use Workbench\App\Models\User;
87

98
abstract class TestCase extends BaseTestCase
109
{
1110
use WithWorkbench;
1211

13-
protected ?User $superAdmin = null;
14-
15-
protected ?User $user = null;
16-
1712
protected function setUp(): void
1813
{
1914
// Always show errors when testing
@@ -35,31 +30,6 @@ protected function migrate(): self
3530
return $this;
3631
}
3732

38-
/**
39-
* Set up default "super admin" user
40-
*/
41-
protected function setUpSuperAdmin(): self
42-
{
43-
$this->superAdmin = User::factory()->make();
44-
$this->superAdmin->assignRole('super_admin')->save();
45-
46-
$this->actingAs($this->superAdmin);
47-
48-
return $this;
49-
}
50-
51-
/**
52-
* Set up a common user with no roles or permissions
53-
*/
54-
protected function setUpCommonUser(): self
55-
{
56-
$this->user = User::factory()->create();
57-
58-
$this->actingAs($this->user);
59-
60-
return $this;
61-
}
62-
6333
public function ignorePackageDiscoveriesFrom()
6434
{
6535
return [

workbench/app/Models/User.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
use Illuminate\Database\Eloquent\Factories\HasFactory;
88
use Illuminate\Foundation\Auth\User as Authenticatable;
99
use Illuminate\Notifications\Notifiable;
10-
use Spatie\Permission\Traits\HasRoles;
1110
use Workbench\Database\Factories\UserFactory;
1211

1312
class User extends Authenticatable implements FilamentUser
1413
{
15-
use HasFactory, HasRoles, Notifiable;
14+
use HasFactory, Notifiable;
1615

1716
/**
1817
* The attributes that are mass assignable.

workbench/app/Providers/AdminPanelProvider.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Workbench\App\Providers;
44

5-
use BezhanSalleh\FilamentShield\FilamentShieldPlugin;
65
use Filament\Http\Middleware\Authenticate;
76
use Filament\Http\Middleware\DisableBladeIconComponents;
87
use Filament\Http\Middleware\DispatchServingFilamentEvent;
@@ -42,9 +41,6 @@ public function panel(Panel $panel): Panel
4241
->authMiddleware([
4342
Authenticate::class,
4443
])
45-
->plugins([
46-
FilamentShieldPlugin::make(),
47-
])
4844
->pages([
4945
Dashboard::class,
5046
]);

0 commit comments

Comments
 (0)