Skip to content

Commit 28af5de

Browse files
author
Curtis Delicata
committed
Update dependencies
1 parent a0017ae commit 28af5de

110 files changed

Lines changed: 5978 additions & 5024 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/Actions/Fortify/CreateNewUser.php

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

33
namespace App\Actions\Fortify;
44

5+
use Illuminate\Validation\ValidationException;
6+
use Illuminate\Database\QueryException;
7+
use Spatie\Permission\Exceptions\RoleDoesNotExist;
58
use App\Models\Team;
69
use App\Models\User;
710
use Illuminate\Support\Facades\DB;
@@ -20,8 +23,8 @@ class CreateNewUser implements CreatesNewUsers
2023
* Validate and create a newly registered user.
2124
*
2225
* @param array<string, string> $input
23-
* @throws \Illuminate\Validation\ValidationException
24-
* @throws \Exception
26+
* @throws ValidationException
27+
* @throws Exception
2528
*/
2629
public function create(array $input): User
2730
{
@@ -69,21 +72,21 @@ public function create(array $input): User
6972
]);
7073

7174
return $user;
72-
} catch (\Illuminate\Validation\ValidationException $e) {
75+
} catch (ValidationException $e) {
7376
Log::error('User creation validation failed', [
7477
'errors' => $e->errors(),
7578
'input' => array_diff_key($input, array_flip(['password'])),
7679
]);
7780
throw $e;
78-
} catch (\Illuminate\Database\QueryException $e) {
81+
} catch (QueryException $e) {
7982
Log::error('Database error during user creation', [
8083
'message' => $e->getMessage(),
8184
'code' => $e->getCode(),
8285
'sql' => $e->getSql(),
8386
'bindings' => $e->getBindings(),
8487
]);
8588
throw new Exception($this->getDatabaseErrorMessage($e));
86-
} catch (\Spatie\Permission\Exceptions\RoleDoesNotExist $e) {
89+
} catch (RoleDoesNotExist $e) {
8790
Log::error('Invalid role specified during user creation', [
8891
'role' => $input['role'] ?? 'not provided',
8992
'message' => $e->getMessage(),
@@ -99,7 +102,7 @@ public function create(array $input): User
99102
}
100103
}
101104

102-
private function getDatabaseErrorMessage(\Illuminate\Database\QueryException $e): string
105+
private function getDatabaseErrorMessage(QueryException $e): string
103106
{
104107
$errorCode = $e->getCode();
105108
$errorMessage = $e->getMessage();
@@ -118,7 +121,7 @@ private function getDatabaseErrorMessage(\Illuminate\Database\QueryException $e)
118121
/**
119122
* Assign the user to the first team or create a personal team.
120123
*
121-
* @throws \Exception
124+
* @throws Exception
122125
*/
123126
protected function assignOrCreateTeam(User $user): Team
124127
{

app/Actions/Fortify/PasswordValidationRules.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
namespace App\Actions\Fortify;
44

5+
use Illuminate\Contracts\Validation\Rule;
56
use Illuminate\Validation\Rules\Password;
67

78
trait PasswordValidationRules
89
{
910
/**
1011
* Get the validation rules used to validate passwords.
1112
*
12-
* @return array<int, \Illuminate\Contracts\Validation\Rule|array<mixed>|string>
13+
* @return array<int, Rule|array<mixed>|string>
1314
*/
1415
protected function passwordRules(): array
1516
{

app/Actions/Fortify/ResetUserPassword.php

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

33
namespace App\Actions\Fortify;
44

5+
use Illuminate\Validation\ValidationException;
56
use App\Models\User;
67
use Illuminate\Support\Facades\Hash;
78
use Illuminate\Support\Facades\Log;
@@ -17,8 +18,8 @@ class ResetUserPassword implements ResetsUserPasswords
1718
* Validate and reset the user's forgotten password.
1819
*
1920
* @param array<string, string> $input
20-
* @throws \Illuminate\Validation\ValidationException
21-
* @throws \Exception
21+
* @throws ValidationException
22+
* @throws Exception
2223
*/
2324
public function reset(User $user, array $input): void
2425
{
@@ -32,7 +33,7 @@ public function reset(User $user, array $input): void
3233
])->save();
3334

3435
Log::info('User password reset successfully', ['user_id' => $user->id]);
35-
} catch (\Illuminate\Validation\ValidationException $e) {
36+
} catch (ValidationException $e) {
3637
Log::error('Password reset validation failed', [
3738
'user_id' => $user->id,
3839
'errors' => $e->errors(),

app/Actions/Fortify/UpdateUserPassword.php

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

33
namespace App\Actions\Fortify;
44

5+
use Illuminate\Validation\ValidationException;
56
use App\Models\User;
67
use Illuminate\Support\Facades\Hash;
78
use Illuminate\Support\Facades\Log;
@@ -17,8 +18,8 @@ class UpdateUserPassword implements UpdatesUserPasswords
1718
* Validate and update the user's password.
1819
*
1920
* @param array<string, string> $input
20-
* @throws \Illuminate\Validation\ValidationException
21-
* @throws \Exception
21+
* @throws ValidationException
22+
* @throws Exception
2223
*/
2324
public function update(User $user, array $input): void
2425
{
@@ -35,7 +36,7 @@ public function update(User $user, array $input): void
3536
])->save();
3637

3738
Log::info('User password updated successfully', ['user_id' => $user->id]);
38-
} catch (\Illuminate\Validation\ValidationException $e) {
39+
} catch (ValidationException $e) {
3940
Log::error('Password update validation failed', [
4041
'user_id' => $user->id,
4142
'errors' => $e->errors(),

app/Actions/Jetstream/AddTeamMember.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Actions\Jetstream;
44

5+
use Illuminate\Contracts\Validation\Rule;
56
use App\Models\Team;
67
use App\Models\User;
78
use Closure;
@@ -54,7 +55,7 @@ protected function validate(Team $team, string $email, ?string $role): void
5455
/**
5556
* Get the validation rules for adding a team member.
5657
*
57-
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
58+
* @return array<string, Rule|array|string>
5859
*/
5960
protected function rules(): array
6061
{

app/Console/Commands/ModuleCommand.php

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

33
namespace App\Console\Commands;
44

5+
use Exception;
56
use App\Modules\ModuleManager;
67
use Illuminate\Console\Command;
78
use Illuminate\Support\Facades\File;
@@ -91,7 +92,7 @@ protected function enableModule(?string $name): int
9192

9293
$this->error("Module '{$name}' not found.");
9394
return 1;
94-
} catch (\Exception $e) {
95+
} catch (Exception $e) {
9596
$this->error("Failed to enable module '{$name}': " . $e->getMessage());
9697
return 1;
9798
}
@@ -115,7 +116,7 @@ protected function disableModule(?string $name): int
115116

116117
$this->error("Module '{$name}' not found.");
117118
return 1;
118-
} catch (\Exception $e) {
119+
} catch (Exception $e) {
119120
$this->error("Failed to disable module '{$name}': " . $e->getMessage());
120121
return 1;
121122
}
@@ -139,7 +140,7 @@ protected function installModule(?string $name): int
139140

140141
$this->error("Module '{$name}' not found.");
141142
return 1;
142-
} catch (\Exception $e) {
143+
} catch (Exception $e) {
143144
$this->error("Failed to install module '{$name}': " . $e->getMessage());
144145
return 1;
145146
}
@@ -170,7 +171,7 @@ protected function uninstallModule(?string $name): int
170171

171172
$this->error("Module '{$name}' not found.");
172173
return 1;
173-
} catch (\Exception $e) {
174+
} catch (Exception $e) {
174175
$this->error("Failed to uninstall module '{$name}': " . $e->getMessage());
175176
return 1;
176177
}

app/Filament/Admin/Resources/ModuleResource.php

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,21 @@
22

33
namespace App\Filament\Resources;
44

5+
use Filament\Schemas\Schema;
6+
use Filament\Forms\Components\TextInput;
7+
use Filament\Forms\Components\Textarea;
8+
use Filament\Forms\Components\Toggle;
9+
use Filament\Tables\Columns\TextColumn;
10+
use Filament\Tables\Columns\IconColumn;
11+
use Filament\Tables\Filters\TernaryFilter;
12+
use Filament\Actions\Action;
13+
use Filament\Actions\ViewAction;
14+
use Filament\Actions\BulkActionGroup;
15+
use Filament\Actions\BulkAction;
16+
use App\Filament\Resources\Pages\ListModules;
17+
use App\Filament\Resources\Pages\ViewModule;
518
use App\Modules\ModuleManager;
619
use Filament\Forms;
7-
use Filament\Forms\Form;
820
use Filament\Resources\Resource;
921
use Filament\Tables;
1022
use Filament\Tables\Table;
@@ -15,24 +27,24 @@ class ModuleResource extends Resource
1527
{
1628
protected static ?string $model = null;
1729

18-
protected static ?string $navigationIcon = 'heroicon-o-puzzle-piece';
30+
protected static string | \BackedEnum | null $navigationIcon = 'heroicon-o-puzzle-piece';
1931

20-
protected static ?string $navigationGroup = 'System';
32+
protected static string | \UnitEnum | null $navigationGroup = 'System';
2133

2234
protected static ?string $navigationLabel = 'Modules';
2335

24-
public static function form(Form $form): Form
36+
public static function form(Schema $schema): Schema
2537
{
26-
return $form
27-
->schema([
28-
Forms\Components\TextInput::make('name')
38+
return $schema
39+
->components([
40+
TextInput::make('name')
2941
->required()
3042
->disabled(),
31-
Forms\Components\TextInput::make('version')
43+
TextInput::make('version')
3244
->disabled(),
33-
Forms\Components\Textarea::make('description')
45+
Textarea::make('description')
3446
->disabled(),
35-
Forms\Components\Toggle::make('enabled')
47+
Toggle::make('enabled')
3648
->required(),
3749
]);
3850
}
@@ -42,25 +54,25 @@ public static function table(Table $table): Table
4254
return $table
4355
->query(static::getEloquentQuery())
4456
->columns([
45-
Tables\Columns\TextColumn::make('name')
57+
TextColumn::make('name')
4658
->searchable()
4759
->sortable(),
48-
Tables\Columns\TextColumn::make('version')
60+
TextColumn::make('version')
4961
->sortable(),
50-
Tables\Columns\TextColumn::make('description')
62+
TextColumn::make('description')
5163
->limit(50),
52-
Tables\Columns\IconColumn::make('enabled')
64+
IconColumn::make('enabled')
5365
->boolean()
5466
->trueIcon('heroicon-o-check-circle')
5567
->falseIcon('heroicon-o-x-circle')
5668
->trueColor('success')
5769
->falseColor('danger'),
58-
Tables\Columns\TextColumn::make('dependencies')
70+
TextColumn::make('dependencies')
5971
->formatStateUsing(fn ($state) => is_array($state) ? implode(', ', $state) : $state)
6072
->limit(30),
6173
])
6274
->filters([
63-
Tables\Filters\TernaryFilter::make('enabled')
75+
TernaryFilter::make('enabled')
6476
->label('Status')
6577
->trueLabel('Enabled')
6678
->falseLabel('Disabled')
@@ -69,8 +81,8 @@ public static function table(Table $table): Table
6981
false: fn (Builder $query) => $query->where('enabled', false),
7082
),
7183
])
72-
->actions([
73-
Tables\Actions\Action::make('toggle')
84+
->recordActions([
85+
Action::make('toggle')
7486
->label(fn ($record) => $record->enabled ? 'Disable' : 'Enable')
7587
->icon(fn ($record) => $record->enabled ? 'heroicon-o-x-circle' : 'heroicon-o-check-circle')
7688
->color(fn ($record) => $record->enabled ? 'danger' : 'success')
@@ -84,7 +96,7 @@ public static function table(Table $table): Table
8496
}
8597
})
8698
->requiresConfirmation(),
87-
Tables\Actions\Action::make('install')
99+
Action::make('install')
88100
->label('Install')
89101
->icon('heroicon-o-arrow-down-tray')
90102
->color('info')
@@ -94,7 +106,7 @@ public static function table(Table $table): Table
94106
})
95107
->visible(fn ($record) => !$record->enabled)
96108
->requiresConfirmation(),
97-
Tables\Actions\Action::make('uninstall')
109+
Action::make('uninstall')
98110
->label('Uninstall')
99111
->icon('heroicon-o-trash')
100112
->color('danger')
@@ -104,11 +116,11 @@ public static function table(Table $table): Table
104116
})
105117
->visible(fn ($record) => $record->enabled)
106118
->requiresConfirmation(),
107-
Tables\Actions\ViewAction::make(),
119+
ViewAction::make(),
108120
])
109-
->bulkActions([
110-
Tables\Actions\BulkActionGroup::make([
111-
Tables\Actions\BulkAction::make('enable')
121+
->toolbarActions([
122+
BulkActionGroup::make([
123+
BulkAction::make('enable')
112124
->label('Enable Selected')
113125
->icon('heroicon-o-check-circle')
114126
->color('success')
@@ -119,7 +131,7 @@ public static function table(Table $table): Table
119131
}
120132
})
121133
->requiresConfirmation(),
122-
Tables\Actions\BulkAction::make('disable')
134+
BulkAction::make('disable')
123135
->label('Disable Selected')
124136
->icon('heroicon-o-x-circle')
125137
->color('danger')
@@ -179,8 +191,8 @@ public function where($column, $operator = null, $value = null, $boolean = 'and'
179191
public static function getPages(): array
180192
{
181193
return [
182-
'index' => Pages\ListModules::route('/'),
183-
'view' => Pages\ViewModule::route('/{record}'),
194+
'index' => ListModules::route('/'),
195+
'view' => ViewModule::route('/{record}'),
184196
];
185197
}
186198
}

app/Filament/Admin/Resources/ModuleResource/Pages/ListModules.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Filament\Resources\ModuleResource\Pages;
44

5+
use Filament\Actions\Action;
56
use App\Filament\Resources\ModuleResource;
67
use Filament\Actions;
78
use Filament\Resources\Pages\ListRecords;
@@ -13,7 +14,7 @@ class ListModules extends ListRecords
1314
protected function getHeaderActions(): array
1415
{
1516
return [
16-
Actions\Action::make('refresh')
17+
Action::make('refresh')
1718
->label('Refresh Modules')
1819
->icon('heroicon-o-arrow-path')
1920
->action(function () {

app/Filament/Admin/Resources/ModuleResource/Pages/ViewModule.php

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

33
namespace App\Filament\Resources\ModuleResource\Pages;
44

5+
use Filament\Actions\Action;
6+
use App\Modules\ModuleManager;
57
use App\Filament\Resources\ModuleResource;
68
use Filament\Actions;
79
use Filament\Resources\Pages\ViewRecord;
@@ -13,12 +15,12 @@ class ViewModule extends ViewRecord
1315
protected function getHeaderActions(): array
1416
{
1517
return [
16-
Actions\Action::make('toggle')
18+
Action::make('toggle')
1719
->label(fn () => $this->record->enabled ? 'Disable' : 'Enable')
1820
->icon(fn () => $this->record->enabled ? 'heroicon-o-x-circle' : 'heroicon-o-check-circle')
1921
->color(fn () => $this->record->enabled ? 'danger' : 'success')
2022
->action(function () {
21-
$moduleManager = app(\App\Modules\ModuleManager::class);
23+
$moduleManager = app(ModuleManager::class);
2224

2325
if ($this->record->enabled) {
2426
$moduleManager->disable($this->record->name);

0 commit comments

Comments
 (0)