Skip to content

Commit e042d9b

Browse files
simonhampclaude
andcommitted
Apply Rector upgrades and Laravel 12 compatibility changes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 102ba69 commit e042d9b

74 files changed

Lines changed: 412 additions & 257 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/Console/Commands/ExtendLicenseExpiryCommand.php

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

33
namespace App\Console\Commands;
44

5+
use App\Jobs\UpdateAnystackLicenseExpiryJob;
56
use App\Models\License;
67
use Illuminate\Console\Command;
78

@@ -37,7 +38,7 @@ public function handle(): int
3738
}
3839

3940
// Dispatch the job to update the license expiry
40-
dispatch(new \App\Jobs\UpdateAnystackLicenseExpiryJob($license));
41+
dispatch(new UpdateAnystackLicenseExpiryJob($license));
4142

4243
$this->info("License expiry updated to {$license->expires_at->format('Y-m-d')}");
4344

app/Console/Commands/MatchUsersWithStripeCustomers.php

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

55
use App\Models\User;
66
use Illuminate\Console\Command;
7+
use Illuminate\Support\Sleep;
78
use Stripe\Customer;
89
use Stripe\Exception\ApiErrorException;
910

@@ -82,7 +83,7 @@ public function handle(): int
8283
$progressBar->advance();
8384

8485
// Add a small delay to avoid rate limiting
85-
\Illuminate\Support\Sleep::usleep(100000); // 0.1 seconds
86+
Sleep::usleep(100000); // 0.1 seconds
8687
}
8788

8889
$progressBar->finish();

app/Console/Commands/SatisBuild.php

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

33
namespace App\Console\Commands;
44

5+
use App\Models\Plugin;
56
use App\Services\SatisService;
67
use Illuminate\Console\Command;
78

@@ -30,7 +31,7 @@ public function handle(SatisService $satisService): int
3031
$pluginName = $this->option('plugin');
3132

3233
if ($pluginName) {
33-
$plugin = \App\Models\Plugin::where('name', $pluginName)->first();
34+
$plugin = Plugin::where('name', $pluginName)->first();
3435

3536
if (! $plugin) {
3637
$this->error("Plugin '{$pluginName}' not found.");

app/Console/Commands/SendLegacyLicenseThankYou.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use App\Models\License;
66
use App\Notifications\LegacyLicenseThankYou;
77
use Illuminate\Console\Command;
8+
use Illuminate\Support\Facades\Date;
89

910
class SendLegacyLicenseThankYou extends Command
1011
{
@@ -25,7 +26,7 @@ public function handle(): int
2526
// that have a user and haven't been converted to a subscription
2627
$legacyLicenses = License::query()
2728
->whereNull('subscription_item_id')
28-
->where('created_at', '<', \Illuminate\Support\Facades\Date::create(2025, 5, 8))
29+
->where('created_at', '<', Date::create(2025, 5, 8))
2930
->whereHas('user')
3031
->with('user')
3132
->get();

app/Console/Commands/SyncPlugins.php

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

33
namespace App\Console\Commands;
44

5+
use App\Jobs\SyncPlugin;
56
use App\Models\Plugin;
67
use Illuminate\Console\Command;
78

@@ -25,7 +26,7 @@ public function handle(): int
2526

2627
$this->info("Dispatching sync jobs for {$count} plugins...");
2728

28-
$plugins->each(fn (Plugin $plugin) => dispatch(new \App\Jobs\SyncPlugin($plugin)));
29+
$plugins->each(fn (Plugin $plugin) => dispatch(new SyncPlugin($plugin)));
2930

3031
$this->info('Done. Jobs have been dispatched to the queue.');
3132

app/Filament/Resources/ArticleResource/Actions/PublishAction.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Filament\Actions\Action;
77
use Filament\Forms\Components\DateTimePicker;
88
use Filament\Forms\Components\Radio;
9+
use Illuminate\Support\Facades\Date;
910

1011
class PublishAction extends Action
1112
{
@@ -37,7 +38,7 @@ protected function setUp(): void
3738
if ($data['publish_type'] === 'now') {
3839
$article->publish();
3940
} else {
40-
$article->publish(\Illuminate\Support\Facades\Date::parse($data['published_at']));
41+
$article->publish(Date::parse($data['published_at']));
4142
}
4243
});
4344
}

app/Filament/Resources/ArticleResource/Actions/ScheduleAction.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use App\Models\Article;
66
use Filament\Actions\Action;
77
use Filament\Forms\Components\DateTimePicker;
8+
use Illuminate\Support\Facades\Date;
89

910
class ScheduleAction extends Action
1011
{
@@ -24,7 +25,7 @@ protected function setUp(): void
2425
->required(),
2526
])
2627
->action(function (Article $article, array $data): void {
27-
$article->publish(\Illuminate\Support\Facades\Date::parse($data['published_at']));
28+
$article->publish(Date::parse($data['published_at']));
2829
})
2930
->requiresConfirmation();
3031
}

app/Filament/Resources/ArticleResource/Pages/EditArticle.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
use App\Filament\Resources\ArticleResource;
66
use App\Services\OgImageService;
77
use Filament\Actions;
8+
use Filament\Forms\Components\DateTimePicker;
9+
use Filament\Forms\Components\Radio;
810
use Filament\Resources\Pages\EditRecord;
11+
use Illuminate\Support\Facades\Date;
912

1013
class EditArticle extends EditRecord
1114
{
@@ -36,7 +39,7 @@ protected function getHeaderActions(): array
3639
->icon('heroicon-o-newspaper')
3740
->visible(fn () => ! $this->record->isPublished())
3841
->form([
39-
\Filament\Forms\Components\Radio::make('publish_type')
42+
Radio::make('publish_type')
4043
->label('Publish Options')
4144
->options([
4245
'now' => 'Publish Now',
@@ -45,7 +48,7 @@ protected function getHeaderActions(): array
4548
->default('now')
4649
->live()
4750
->required(),
48-
\Filament\Forms\Components\DateTimePicker::make('published_at')
51+
DateTimePicker::make('published_at')
4952
->label('Published At')
5053
->displayFormat('M j, Y H:i')
5154
->seconds(false)
@@ -57,7 +60,7 @@ protected function getHeaderActions(): array
5760
if ($data['publish_type'] === 'now') {
5861
$this->record->publish();
5962
} else {
60-
$this->record->publish(\Illuminate\Support\Facades\Date::parse($data['published_at']));
63+
$this->record->publish(Date::parse($data['published_at']));
6164
}
6265
}),
6366
Actions\DeleteAction::make(),

app/Filament/Resources/UserResource/Pages/EditUser.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

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

5+
use App\Enums\Subscription;
56
use App\Filament\Resources\UserResource;
7+
use App\Jobs\CreateAnystackLicenseJob;
68
use App\Models\User;
79
use Filament\Actions;
10+
use Filament\Forms\Components\Select;
811
use Filament\Notifications\Notification;
912
use Filament\Resources\Pages\EditRecord;
13+
use Illuminate\Support\Facades\Password;
1014

1115
class EditUser extends EditRecord
1216
{
@@ -39,17 +43,17 @@ protected function getHeaderActions(): array
3943
->color('gray')
4044
->icon('heroicon-o-key')
4145
->form([
42-
\Filament\Forms\Components\Select::make('subscription')
46+
Select::make('subscription')
4347
->label('Subscription Plan')
44-
->options(collect(\App\Enums\Subscription::cases())->mapWithKeys(function ($case) {
48+
->options(collect(Subscription::cases())->mapWithKeys(function ($case) {
4549
return [$case->value => $case->name()];
4650
}))
4751
->required(),
4852
])
4953
->action(function (array $data, User $record): void {
50-
$subscription = \App\Enums\Subscription::from($data['subscription']);
54+
$subscription = Subscription::from($data['subscription']);
5155

52-
dispatch(new \App\Jobs\CreateAnystackLicenseJob($record, $subscription, null, $record->first_name, $record->last_name));
56+
dispatch(new CreateAnystackLicenseJob($record, $subscription, null, $record->first_name, $record->last_name));
5357
}),
5458

5559
Actions\Action::make('sendPasswordReset')
@@ -58,7 +62,7 @@ protected function getHeaderActions(): array
5862
->icon('heroicon-o-envelope')
5963
->requiresConfirmation()
6064
->action(function (User $record): void {
61-
\Illuminate\Support\Facades\Password::sendResetLink(
65+
Password::sendResetLink(
6266
['email' => $record->email]
6367
);
6468
}),

app/Http/Controllers/Api/LicenseController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use App\Enums\Subscription;
77
use App\Http\Controllers\Controller;
88
use App\Http\Resources\Api\LicenseResource;
9+
use App\Jobs\CreateAnystackLicenseJob;
910
use App\Models\License;
1011
use App\Models\User;
1112
use Illuminate\Http\Request;
@@ -48,7 +49,7 @@ public function store(Request $request)
4849
// Create the license via job
4950
$subscription = Subscription::from($validated['subscription']);
5051

51-
dispatch_sync(new \App\Jobs\CreateAnystackLicenseJob(
52+
dispatch_sync(new CreateAnystackLicenseJob(
5253
user: $user,
5354
subscription: $subscription,
5455
subscriptionItemId: null,

0 commit comments

Comments
 (0)