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 #116

Merged
merged 25 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
669b536
Apply code style
laravel-shift Oct 15, 2024
efd2776
Use Faker methods
laravel-shift Oct 15, 2024
f76e21f
Remove unnecessary `$model` property
laravel-shift Oct 15, 2024
e309038
Convert route options to fluent methods
laravel-shift Oct 15, 2024
0679acd
Remove default `app` files
laravel-shift Oct 15, 2024
299e52b
Shift core files
laravel-shift Oct 15, 2024
822bd42
Streamline config files
laravel-shift Oct 15, 2024
6be445c
Set new `ENV` variables
laravel-shift Oct 15, 2024
0b6715b
Default new `bootstrap/app.php`
laravel-shift Oct 15, 2024
e780f87
Re-register HTTP middleware
laravel-shift Oct 15, 2024
100c62f
Consolidate service providers
laravel-shift Oct 15, 2024
ca0a90e
Re-register service providers
laravel-shift Oct 15, 2024
7f3d2dd
Re-register routes
laravel-shift Oct 15, 2024
713c9c1
Re-register scheduled commands
laravel-shift Oct 15, 2024
a3fb951
Bump Composer dependencies
laravel-shift Oct 15, 2024
b1cd122
Convert `$casts` property to method
laravel-shift Oct 15, 2024
c5eabf6
Mark base controller as `abstract`
laravel-shift Oct 15, 2024
19b662e
Remove `CreatesApplication` testing trait
laravel-shift Oct 15, 2024
9bf61c8
Shift cleanup
laravel-shift Oct 15, 2024
dc6d6cc
idk
ericwang401 Nov 7, 2024
258eff7
Remove unnecessary authenticate middleware
ericwang401 Nov 8, 2024
5496e0e
Remove ApiController.php
ericwang401 Nov 8, 2024
ebe6a65
Update default environment file
ericwang401 Nov 8, 2024
e6566cb
Update migrations to be agnostic
ericwang401 Nov 8, 2024
b095525
Add full env file to release.yml
ericwang401 Nov 8, 2024
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
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
Loading