Skip to content

Commit

Permalink
Merge pull request #116 from ConvoyPanel/shift-130906
Browse files Browse the repository at this point in the history
Laravel 11.x Shift
  • Loading branch information
ericwang401 authored Nov 8, 2024
2 parents 3b8431b + b095525 commit 01f601d
Show file tree
Hide file tree
Showing 317 changed files with 3,254 additions and 4,429 deletions.
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
8 changes: 4 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
APP_TIMEZONE=UTC
APP_LOCALE=en
APP_MAINTENANCE_DRIVER=cache

DB_CONNECTION=mysql
DB_HOST=database
Expand All @@ -15,7 +15,7 @@ DB_DATABASE=convoy
DB_USERNAME=convoy_user
DB_PASSWORD=

CACHE_DRIVER=redis
CACHE_STORE=redis
FILESYSTEM_DISK=local
QUEUE_CONNECTION=redis
SESSION_DRIVER=redis
Expand Down
50 changes: 50 additions & 0 deletions .env.full_example
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
APP_NAME=Convoy
APP_ENV=local
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

DB_CONNECTION=mysql
DB_HOST=database
DB_PORT=3306
DB_DATABASE=convoy
DB_USERNAME=convoy_user
DB_PASSWORD=

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=
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"

PHP_XDEBUG=false
PHP_XDEBUG_MODE='debug'
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
files_to_include=(
".editorconfig"
".env.example"
".env.full_example"
".gitattributes"
".gitignore"
".prettierignore"
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 App\Actions\Fortify;

use App\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 App\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 App\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 @@ -2,10 +2,10 @@

namespace App\Console\Commands\Maintenance;

use App\Repositories\Eloquent\BackupRepository;
use Carbon\CarbonImmutable;
use InvalidArgumentException;
use Illuminate\Console\Command;
use App\Repositories\Eloquent\BackupRepository;
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 App\Console\Commands\Maintenance;

use App\Jobs\Node\PruneUsersJob;
use App\Models\Node;
use Illuminate\Console\Command;
use App\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 App\Console\Commands\Server;

use App\Jobs\Node\SyncServerRateLimitsJob;
use App\Models\Node;
use Illuminate\Console\Command;
use Illuminate\Console\View\Components\Task;
use App\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 App\Console\Commands\Server;

use App\Jobs\Node\SyncServerUsagesJob;
use App\Models\Node;
use Illuminate\Console\Command;
use App\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 App\Console\Commands\User;

use Exception;
use App\Exceptions\Model\DataValidationException;
use App\Models\User;
use Exception;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Hash;
use App\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 App\Contracts\Repository;

use App\Models\Server;
use App\Models\ActivityLog;
use App\Models\Server;

interface ActivityRepositoryInterface extends RepositoryInterface
{
Expand Down
6 changes: 3 additions & 3 deletions app/Contracts/Repository/RepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace App\Contracts\Repository;

use Closure;
use Illuminate\Support\Collection;
use App\Exceptions\Model\DataValidationException;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
use App\Exceptions\Repository\RecordNotFoundException;
use Closure;
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 App\Contracts\Repository;

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

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

namespace App\Data\Helpers;

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

class ChecksumData extends Data
{
public function __construct(
public string $checksum,
public string $checksum,
public ChecksumAlgorithm $algorithm,
) {
}
Expand Down
18 changes: 9 additions & 9 deletions app/Data/Node/Access/CreateUserData.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@

namespace App\Data\Node\Access;

use Carbon\Carbon;
use Spatie\LaravelData\Data;
use Spatie\LaravelData\Casts\EnumCast;
use App\Enums\Node\Access\RealmType;
use Spatie\LaravelData\Attributes\WithCast;
use Spatie\LaravelData\Attributes\Validation\Min;
use Carbon\Carbon;
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,
) {
}
}
11 changes: 5 additions & 6 deletions app/Data/Node/Access/UserCredentialsData.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@

namespace App\Data\Node\Access;

use Spatie\LaravelData\Data;
use App\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 Down
Loading

0 comments on commit 01f601d

Please sign in to comment.