Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrated User model #960

Merged
merged 5 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Console/Commands/Campaigns/ExportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use App\Models\Campaign;
use App\Services\Campaign\ExportService;
use App\User;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Console\Command;

Expand Down
44 changes: 44 additions & 0 deletions app/Console/Commands/Migrations/MigrateNotifications.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

namespace App\Console\Commands\Migrations;

use App\Models\Notification;
use Illuminate\Console\Command;

class MigrateNotifications extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'users:migrate-notifications';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Migrate user notifications';

private $count = 0;
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
Notification::where('notifiable_type', 'App\User')
->chunk(5000, function ($notifications): void {
/** @var Notification $notification */
foreach ($notifications as $notification) {
$this->count++;
$notification->updateQuietly(['notifiable_type' => 'App\Models\User']);
spitfire305 marked this conversation as resolved.
Show resolved Hide resolved
}
});

$this->info('Migrated ' . $this->count . ' user notifications.');
return Command::SUCCESS;
}
}
2 changes: 1 addition & 1 deletion app/Console/Commands/Migrations/MigrateTutorials.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Console\Commands\Migrations;

use App\Models\Users\Tutorial;
use App\User;
use App\Models\User;
use Illuminate\Console\Command;
use Illuminate\Support\Str;

Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Migrations/MigrateUserPreferences.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Console\Commands\Migrations;

use App\User;
use App\Models\User;
use Illuminate\Console\Command;

class MigrateUserPreferences extends Command
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Migrations/NewsletterSubCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Console\Commands\Migrations;

use App\Services\NewsletterService;
use App\User;
use App\Models\User;
use Illuminate\Console\Command;

class NewsletterSubCommand extends Command
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/PurgeBots.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Console\Commands;

use App\Jobs\Users\DeleteUser;
use App\User;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Console\Command;
use Illuminate\Support\Str;
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/RegenerateDiscordToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Console\Commands;

use App\Services\DiscordService;
use App\User;
use App\Models\User;
use Carbon\Carbon;
use App\Models\UserApp;
use Illuminate\Console\Command;
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/ResetUserPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Console\Commands;

use App\Models\UserLog;
use App\User;
use App\Models\User;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/SendNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Console\Commands;

use App\Notifications\Header;
use App\User;
use App\Models\User;
use Illuminate\Console\Command;

class SendNotification extends Command
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Subscriptions/ExpiringCardCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use App\Jobs\Emails\Subscriptions\ExpiringCardAlert;
use App\Traits\HasJobLog;
use App\User;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Console\Command;

Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Subscriptions/SubCleanupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Console\Commands\Subscriptions;

use App\Jobs\SubscriptionEndJob;
use App\User;
use App\Models\User;
use Illuminate\Console\Command;

class SubCleanupCommand extends Command
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/SyncUserRoles.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Console\Commands;

use App\Services\DiscordService;
use App\User;
use App\Models\User;
use Illuminate\Console\Command;

class SyncUserRoles extends Command
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/TestEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class TestEmail extends Command
public function handle()
{
$userId = $this->argument('user');
$user = \App\User::findOrFail($userId);
$user = \App\Models\User::findOrFail($userId);

$template = $this->argument('template');
if ($template === 'welcome') {
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Tests/Mailerlite.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Console\Commands\Tests;

use App\Services\NewsletterService;
use App\User;
use App\Models\User;
use Illuminate\Console\Command;

class Mailerlite extends Command
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/v1/Campaign/UserApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use App\Http\Requests\API\UpdateUserRole;
use App\Http\Resources\UserResource;
use App\Models\Campaign;
use App\User;
use App\Models\User;
use App\Services\Campaign\MemberService;

class UserApiController extends ApiController
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use App\Http\Controllers\Controller;
use App\Services\ReferralService;
use App\User;
use App\Models\User;
use Exception;
use Illuminate\Auth\Events\Registered;
use Illuminate\Http\Request;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use App\Http\Controllers\Controller;
use App\Services\UserAuthenticatedService;
use App\User;
use App\Models\User;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use App\Http\Controllers\Controller;
use App\Rules\AccountEmail;
use App\Rules\AccountName;
use App\User;
use App\Models\User;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Billing/HistoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Http\Controllers\Billing;

use App\Http\Controllers\Controller;
use App\User;
use App\Models\User;
use Illuminate\Http\Request;

class HistoryController extends Controller
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/InvitationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use App\Exceptions\RequireLoginException;
use App\Services\InviteService;
use App\User;
use App\Models\User;
use Exception;

class InvitationController extends Controller
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/NotificationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Http\Controllers;

use App\Services\Layout\NavigationService;
use App\User;
use App\Models\User;

class NotificationController extends Controller
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/PasswordSecurityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Http\Controllers;

use App\Http\Requests\Settings\UserEnableTfa;
use App\User;
use App\Models\User;
use Illuminate\Http\Request;
use PragmaRX\Google2FA\Google2FA;
use App\Models\PasswordSecurity;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Settings/AppearanceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function update(StoreSettingsLayout $request)
if ($request->ajax()) {
return response()->json();
}
/** @var \App\User $user */
/** @var \App\Models\User $user */
$user = $request->user();
$settingFields = $request->only([
'editor', 'advanced_mentions', 'new_entity_workflow',
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Settings/BoostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use App\Facades\CampaignCache;
use App\Http\Controllers\Controller;
use App\Models\Campaign;
use App\User;
use App\Models\User;

class BoostController extends Controller
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Settings/PremiumController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use App\Http\Controllers\Controller;
use App\Models\Campaign;
use App\Services\Campaign\BoostService;
use App\User;
use App\Models\User;

class PremiumController extends Controller
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Settings/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use App\Http\Controllers\Controller;
use App\Http\Requests\StoreBillingSettings;
use App\Http\Requests\StoreSettingsProfile;
use App\User;
use App\Models\User;
use Illuminate\Http\Request;

class ProfileController extends Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use App\Http\Requests\ValidateCoupon;
use App\Services\Subscription\CouponService;
use App\Services\SubscriptionService;
use App\User;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Settings/SubscriptionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use App\Services\SubscriptionUpgradeService;
use App\Services\Users\CurrencyService;
use App\Services\Users\EmailValidationService;
use App\User;
use App\Models\User;
use Exception;
use Illuminate\Http\Request;
use Illuminate\Support\Arr;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/User/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Http\Controllers\User;

use App\Http\Controllers\Controller;
use App\User;
use App\Models\User;

class ProfileController extends Controller
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/WebhookController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use App\Models\UserLog;
use App\Services\Subscription\PaymentMethodService;
use App\Services\SubscriptionService;
use App\User;
use App\Models\User;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Log;
use Laravel\Cashier\Http\Controllers\WebhookController as CashierController;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/LocaleChange.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Middleware;

use App\User;
use App\Models\User;
use Closure;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Resources/ProfileResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Resources;

use App\User;
use App\Models\User;
use Illuminate\Http\Resources\Json\JsonResource;

class ProfileResource extends JsonResource
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Resources/UserResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Http\Resources;

use App\Facades\CampaignLocalization;
use App\User;
use App\Models\User;
use Illuminate\Http\Resources\Json\JsonResource;

class UserResource extends JsonResource
Expand Down
2 changes: 1 addition & 1 deletion app/Jobs/Campaigns/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use App\Models\Campaign;
use App\Models\CampaignExport;
use App\Services\Campaign\ExportService;
use App\User;
use App\Models\User;
use Exception;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
Expand Down
2 changes: 1 addition & 1 deletion app/Jobs/Copyright/DeleteUserImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Jobs\Copyright;

use App\User;
use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
Expand Down
2 changes: 1 addition & 1 deletion app/Jobs/DiscordRoleJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Jobs;

use App\Services\DiscordService;
use App\User;
use App\Models\User;
use Exception;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
Expand Down
2 changes: 1 addition & 1 deletion app/Jobs/Emails/MailSettingsChangeJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Jobs\Emails;

use App\Services\NewsletterService;
use App\User;
use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
Expand Down
2 changes: 1 addition & 1 deletion app/Jobs/Emails/Purge/FirstWarningJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use App\Mail\Purge\FirstWarning;
use App\Models\UserLog;
use App\User;
use App\Models\User;
use Exception;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
Expand Down
2 changes: 1 addition & 1 deletion app/Jobs/Emails/Purge/SecondWarningJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use App\Mail\Purge\SecondWarning;
use App\Models\UserLog;
use App\User;
use App\Models\User;
use Exception;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
Expand Down
2 changes: 1 addition & 1 deletion app/Jobs/Emails/SubscriptionCancelEmailJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use App\Mail\Subscription\Admin\CancelledSubscriptionMail;
use App\Mail\Subscription\User\CancelledUserSubscriptionMail;
use App\User;
use App\Models\User;
use App\Models\UserLog;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
Expand Down
Loading