license upgrade function

This commit is contained in:
Čarodej
2022-03-25 10:34:39 +01:00
parent df05eb0433
commit 3c1c6eb5b9
23 changed files with 578 additions and 301 deletions

View File

@@ -1,8 +1,8 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Schema;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{

View File

@@ -1,5 +1,4 @@
<?php
namespace App\Socialite\Controllers;
use App\Users\Models\User;
@@ -8,15 +7,16 @@ use App\Http\Controllers\Controller;
use Laravel\Socialite\Facades\Socialite;
use App\Users\Actions\CreateNewUserAction;
use Illuminate\Contracts\Auth\StatefulGuard;
use VueFileManager\Subscription\Domain\Plans\Exceptions\MeteredBillingPlanDoesntExist;
use VueFileManager\Subscription\Domain\Plans\Models\Plan;
use VueFileManager\Subscription\Domain\Plans\Exceptions\MeteredBillingPlanDoesntExist;
class SocialiteCallbackController extends Controller
{
public function __construct(
protected StatefulGuard $guard,
protected StatefulGuard $guard,
public CreateNewUserAction $createNewUser,
) {}
) {
}
/**
* @throws MeteredBillingPlanDoesntExist
@@ -60,7 +60,7 @@ class SocialiteCallbackController extends Controller
}
// Check if account registration is enabled
if (!$isAllowedRegistration) {
if (! $isAllowedRegistration) {
return response([
'type' => 'error',
'message' => 'User registration is not allowed',

View File

@@ -1,10 +1,9 @@
<?php
namespace App\Users\Actions;
use App\Users\Rules\PasswordValidationRules;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use App\Users\Rules\PasswordValidationRules;
use Laravel\Fortify\Contracts\UpdatesUserPasswords;
class UpdateUserPassword implements UpdatesUserPasswords
@@ -25,7 +24,7 @@ class UpdateUserPassword implements UpdatesUserPasswords
'current_password' => ['required', 'string'],
'password' => $this->passwordRules(),
])->after(function ($validator) use ($user, $input) {
if (!isset($input['current_password']) || !Hash::check($input['current_password'], $user->password)) {
if (! isset($input['current_password']) || ! Hash::check($input['current_password'], $user->password)) {
$validator->errors()->add('current_password', __t('password_doesnt_match'));
}
})->validateWithBag('updatePassword');