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

Laravel 11.x Shift #115

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .env.ci
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DB_DATABASE=convoy
DB_USERNAME=convoy_user
DB_PASSWORD=YzLa2BCBwDGWVkpG

CACHE_DRIVER=redis
CACHE_STORE=redis
FILESYSTEM_DISK=local
QUEUE_CONNECTION=redis
SESSION_DRIVER=redis
Expand Down
14 changes: 13 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@ APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost

APP_TIMEZONE=UTC
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US
APP_MAINTENANCE_DRIVER=file
APP_MAINTENANCE_STORE=database
BCRYPT_ROUNDS=12

LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

Expand All @@ -15,11 +24,14 @@ DB_DATABASE=convoy
DB_USERNAME=convoy_user
DB_PASSWORD=

CACHE_DRIVER=redis
CACHE_STORE=redis
FILESYSTEM_DISK=local
QUEUE_CONNECTION=redis
SESSION_DRIVER=redis
SESSION_LIFETIME=525600
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null

REDIS_HOST=redis
REDIS_PASSWORD=
Expand Down
2 changes: 1 addition & 1 deletion app/Actions/Fortify/CreateNewUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace Convoy\Actions\Fortify;

use Convoy\Models\User;
use Illuminate\Validation\Rule;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\Rule;
use Laravel\Fortify\Contracts\CreatesNewUsers;

class CreateNewUser implements CreatesNewUsers
Expand Down
4 changes: 2 additions & 2 deletions app/Actions/Fortify/UpdateUserProfileInformation.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Convoy\Actions\Fortify;

use Illuminate\Validation\Rule;
use Illuminate\Support\Facades\Validator;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\Rule;
use Laravel\Fortify\Contracts\UpdatesUserProfileInformation;

class UpdateUserProfileInformation implements UpdatesUserProfileInformation
Expand Down
8 changes: 4 additions & 4 deletions app/Casts/NullableEncrypter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Convoy\Casts;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Encryption\Encrypter;
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
use Illuminate\Contracts\Encryption\Encrypter;
use Illuminate\Database\Eloquent\Model;

class NullableEncrypter implements CastsAttributes
{
Expand All @@ -15,7 +15,7 @@ class NullableEncrypter implements CastsAttributes
*/
public function get(Model $model, string $key, mixed $value, array $attributes): ?string
{
return !empty($value) ? app(Encrypter::class)->decrypt($value) : null;
return ! empty($value) ? app(Encrypter::class)->decrypt($value) : null;
}

/**
Expand All @@ -25,6 +25,6 @@ public function get(Model $model, string $key, mixed $value, array $attributes):
*/
public function set(Model $model, string $key, mixed $value, array $attributes): ?string
{
return !empty($value) ? app(Encrypter::class)->encrypt($value) : null;
return ! empty($value) ? app(Encrypter::class)->encrypt($value) : null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace Convoy\Console\Commands\Maintenance;

use Carbon\CarbonImmutable;
use InvalidArgumentException;
use Illuminate\Console\Command;
use Convoy\Repositories\Eloquent\BackupRepository;
use Illuminate\Console\Command;
use InvalidArgumentException;

class PruneOrphanedBackupsCommand extends Command
{
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Maintenance/PruneUsersCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Convoy\Console\Commands\Maintenance;

use Convoy\Jobs\Node\PruneUsersJob;
use Convoy\Models\Node;
use Illuminate\Console\Command;
use Convoy\Jobs\Node\PruneUsersJob;
use Illuminate\Console\View\Components\Task;

class PruneUsersCommand extends Command
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Server/UpdateRateLimitsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Convoy\Console\Commands\Server;

use Convoy\Jobs\Node\SyncServerRateLimitsJob;
use Convoy\Models\Node;
use Illuminate\Console\Command;
use Illuminate\Console\View\Components\Task;
use Convoy\Jobs\Node\SyncServerRateLimitsJob;

class UpdateRateLimitsCommand extends Command
{
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Server/UpdateUsagesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Convoy\Console\Commands\Server;

use Convoy\Jobs\Node\SyncServerUsagesJob;
use Convoy\Models\Node;
use Illuminate\Console\Command;
use Convoy\Jobs\Node\SyncServerUsagesJob;
use Illuminate\Console\View\Components\Task;

class UpdateUsagesCommand extends Command
Expand Down
4 changes: 2 additions & 2 deletions app/Console/Commands/User/MakeUserCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@

namespace Convoy\Console\Commands\User;

use Exception;
use Convoy\Exceptions\Model\DataValidationException;
use Convoy\Models\User;
use Exception;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Hash;
use Convoy\Exceptions\Model\DataValidationException;

class MakeUserCommand extends Command
{
Expand Down
48 changes: 0 additions & 48 deletions app/Console/Kernel.php

This file was deleted.

2 changes: 1 addition & 1 deletion app/Contracts/Repository/ActivityRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Convoy\Contracts\Repository;

use Convoy\Models\Server;
use Convoy\Models\ActivityLog;
use Convoy\Models\Server;

interface ActivityRepositoryInterface extends RepositoryInterface
{
Expand Down
4 changes: 2 additions & 2 deletions app/Contracts/Repository/RepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace Convoy\Contracts\Repository;

use Closure;
use Illuminate\Support\Collection;
use Convoy\Exceptions\Model\DataValidationException;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
use Convoy\Exceptions\Repository\RecordNotFoundException;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection;

interface RepositoryInterface
{
Expand Down
2 changes: 1 addition & 1 deletion app/Contracts/Repository/ServerRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Convoy\Contracts\Repository;

use Convoy\Models\Server;
use Convoy\Exceptions\Repository\RecordNotFoundException;
use Convoy\Models\Server;

interface ServerRepositoryInterface extends RepositoryInterface
{
Expand Down
7 changes: 3 additions & 4 deletions app/Data/Helpers/ChecksumData.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

namespace Convoy\Data\Helpers;

use Spatie\LaravelData\Data;
use Convoy\Enums\Helpers\ChecksumAlgorithm;
use Spatie\LaravelData\Data;

class ChecksumData extends Data
{
public function __construct(
public string $checksum,
public string $checksum,
public ChecksumAlgorithm $algorithm,
)
{
) {
}
}
19 changes: 9 additions & 10 deletions app/Data/Node/Access/CreateUserData.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,24 @@
namespace Convoy\Data\Node\Access;

use Carbon\Carbon;
use Spatie\LaravelData\Data;
use Spatie\LaravelData\Casts\EnumCast;
use Convoy\Enums\Node\Access\RealmType;
use Spatie\LaravelData\Attributes\WithCast;
use Spatie\LaravelData\Attributes\Validation\Min;
use Spatie\LaravelData\Attributes\Validation\Max;
use Spatie\LaravelData\Attributes\Validation\Min;
use Spatie\LaravelData\Attributes\WithCast;
use Spatie\LaravelData\Casts\EnumCast;
use Spatie\LaravelData\Data;

class CreateUserData extends Data
{
public function __construct(
#[WithCast(EnumCast::class)]
public RealmType $realm_type,
public bool $enabled,
public bool $enabled,
#[Min(1), Max(60)]
public ?string $username = null,
public ?string $username = null,
#[Min(1), Max(64)]
public ?string $password = null,
public ?Carbon $expires_at = null,
)
{
public ?string $password = null,
public ?Carbon $expires_at = null,
) {
}
}
16 changes: 7 additions & 9 deletions app/Data/Node/Access/UserCredentialsData.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@

namespace Convoy\Data\Node\Access;

use Spatie\LaravelData\Data;
use Convoy\Enums\Node\Access\RealmType;
use Spatie\LaravelData\Data;

class UserCredentialsData extends Data
{
public function __construct(
public string $username,
public string $username,
public RealmType $realm_type,
public string $ticket,
public string $csrf_token,
)
{

public string $ticket,
public string $csrf_token,
) {
}

public static function fromRaw(array $raw): UserCredentialsData
public static function fromRaw(array $raw): self
{
return new self(...[
'username' => explode('@', $raw['username'])[0],
Expand All @@ -26,4 +24,4 @@ public static function fromRaw(array $raw): UserCredentialsData
'csrf_token' => $raw['CSRFPreventionToken'],
]);
}
}
}
21 changes: 10 additions & 11 deletions app/Data/Node/Access/UserData.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,31 @@
namespace Convoy\Data\Node\Access;

use Carbon\Carbon;
use Illuminate\Support\Arr;
use Spatie\LaravelData\Data;
use Spatie\LaravelData\Casts\EnumCast;
use Convoy\Enums\Node\Access\RealmType;
use Illuminate\Support\Arr;
use Spatie\LaravelData\Attributes\WithCast;
use Spatie\LaravelData\Casts\EnumCast;
use Spatie\LaravelData\Data;

class UserData extends Data
{
public function __construct(
public string $username,
public ?string $email,
public string $username,
public ?string $email,
#[WithCast(EnumCast::class)]
public RealmType $realm_type,
public bool $enabled,
public ?Carbon $expires_at,
)
{
public bool $enabled,
public ?Carbon $expires_at,
) {
}

public static function fromRaw(array $raw): UserData
public static function fromRaw(array $raw): self
{
return new self(...[
'username' => explode('@', $raw['userid'])[0],
'email' => Arr::get($raw, 'email'),
'realm_type' => RealmType::from($raw['realm-type']),
'enabled' => (bool)$raw['enable'],
'enabled' => (bool) $raw['enable'],
'expires_at' => Arr::get($raw, 'expire') ? Carbon::createFromTimestamp($raw['expire']) : null,
]);
}
Expand Down
5 changes: 2 additions & 3 deletions app/Data/Node/Storage/FileMetaData.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ class FileMetaData extends Data
public function __construct(
public string $file_name,
public string $mime_type,
public int $size,
)
{
public int $size,
) {
}
}
7 changes: 3 additions & 4 deletions app/Data/Node/Storage/IsoData.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
class IsoData extends Data
{
public function __construct(
public string $file_name,
public int $size,
public string $file_name,
public int $size,
public CarbonInterface $created_at,
)
{
) {
}
}
Loading
Loading