mirror of
https://github.com/pelican-dev/panel.git
synced 2026-05-04 18:00:48 +03:00
Run composer update and update model phpdocs (#2275)
This commit is contained in:
@@ -14,13 +14,14 @@ use Boquizo\FilamentLogViewer\Utils\Level;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class ListLogs extends BaseListLogs
|
||||
{
|
||||
protected string $view = 'filament.components.list-logs';
|
||||
|
||||
public function getHeading(): string|null|\Illuminate\Contracts\Support\Htmlable
|
||||
public function getHeading(): string|null|Htmlable
|
||||
{
|
||||
return trans('admin/log.navigation.panel_logs');
|
||||
}
|
||||
|
||||
@@ -735,7 +735,7 @@ class EditNode extends EditRecord
|
||||
$set('pulled', false);
|
||||
$set('uploaded', true);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
Notification::make()
|
||||
->title(trans('admin/node.diagnostics.upload_failed'))
|
||||
->body($e->getMessage())
|
||||
|
||||
@@ -150,17 +150,17 @@ class EditServer extends EditRecord
|
||||
|
||||
try {
|
||||
if (!in_array(parse_url($state, PHP_URL_SCHEME), ['http', 'https'], true)) {
|
||||
throw new \Exception(trans('admin/egg.import.invalid_url'));
|
||||
throw new Exception(trans('admin/egg.import.invalid_url'));
|
||||
}
|
||||
|
||||
if (!filter_var($state, FILTER_VALIDATE_URL)) {
|
||||
throw new \Exception(trans('admin/egg.import.invalid_url'));
|
||||
throw new Exception(trans('admin/egg.import.invalid_url'));
|
||||
}
|
||||
|
||||
$extension = strtolower(pathinfo(parse_url($state, PHP_URL_PATH), PATHINFO_EXTENSION));
|
||||
|
||||
if (!array_key_exists($extension, Server::IMAGE_FORMATS)) {
|
||||
throw new \Exception(trans('admin/egg.import.unsupported_format', ['format' => implode(', ', array_keys(Server::IMAGE_FORMATS))]));
|
||||
throw new Exception(trans('admin/egg.import.unsupported_format', ['format' => implode(', ', array_keys(Server::IMAGE_FORMATS))]));
|
||||
}
|
||||
|
||||
$host = parse_url($state, PHP_URL_HOST);
|
||||
@@ -169,14 +169,14 @@ class EditServer extends EditRecord
|
||||
if (
|
||||
filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) === false
|
||||
) {
|
||||
throw new \Exception(trans('admin/egg.import.no_local_ip'));
|
||||
throw new Exception(trans('admin/egg.import.no_local_ip'));
|
||||
}
|
||||
|
||||
$set('imageUrl', $state);
|
||||
$set('imageExtension', $extension);
|
||||
$set('image_url_error', null);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$set('image_url_error', $e->getMessage());
|
||||
$set('imageUrl', null);
|
||||
$set('imageExtension', null);
|
||||
|
||||
@@ -118,17 +118,17 @@ class Settings extends ServerFormPage
|
||||
|
||||
try {
|
||||
if (!in_array(parse_url($state, PHP_URL_SCHEME), ['http', 'https'], true)) {
|
||||
throw new \Exception(trans('admin/egg.import.invalid_url'));
|
||||
throw new Exception(trans('admin/egg.import.invalid_url'));
|
||||
}
|
||||
|
||||
if (!filter_var($state, FILTER_VALIDATE_URL)) {
|
||||
throw new \Exception(trans('admin/egg.import.invalid_url'));
|
||||
throw new Exception(trans('admin/egg.import.invalid_url'));
|
||||
}
|
||||
|
||||
$extension = strtolower(pathinfo(parse_url($state, PHP_URL_PATH), PATHINFO_EXTENSION));
|
||||
|
||||
if (!array_key_exists($extension, Server::IMAGE_FORMATS)) {
|
||||
throw new \Exception(trans('admin/egg.import.unsupported_format', ['format' => implode(', ', array_keys(Server::IMAGE_FORMATS))]));
|
||||
throw new Exception(trans('admin/egg.import.unsupported_format', ['format' => implode(', ', array_keys(Server::IMAGE_FORMATS))]));
|
||||
}
|
||||
|
||||
$host = parse_url($state, PHP_URL_HOST);
|
||||
@@ -137,14 +137,14 @@ class Settings extends ServerFormPage
|
||||
if (
|
||||
filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) === false
|
||||
) {
|
||||
throw new \Exception(trans('admin/egg.import.no_local_ip'));
|
||||
throw new Exception(trans('admin/egg.import.no_local_ip'));
|
||||
}
|
||||
|
||||
$set('imageUrl', $state);
|
||||
$set('imageExtension', $extension);
|
||||
$set('image_url_error', null);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$set('image_url_error', $e->getMessage());
|
||||
$set('imageUrl', null);
|
||||
$set('imageExtension', null);
|
||||
|
||||
@@ -139,6 +139,7 @@ class ActivityResource extends Resource
|
||||
]);
|
||||
}
|
||||
|
||||
/** @return Builder<ActivityLog> */
|
||||
public static function getEloquentQuery(): Builder
|
||||
{
|
||||
/** @var Server $server */
|
||||
|
||||
@@ -259,9 +259,9 @@ class EditFiles extends Page
|
||||
return $this->fileRepository;
|
||||
}
|
||||
|
||||
public static function getUrl(array $parameters = [], bool $isAbsolute = true, ?string $panel = null, ?Model $tenant = null, bool $shouldGuessMissingParameters = false): string
|
||||
public static function getUrl(array $parameters = [], bool $isAbsolute = true, ?string $panel = null, ?Model $tenant = null, bool $shouldGuessMissingParameters = false, ?string $configuration = null): string
|
||||
{
|
||||
return parent::getUrl($parameters, $isAbsolute, $panel, $tenant) . '/';
|
||||
return parent::getUrl($parameters, $isAbsolute, $panel, $tenant, $shouldGuessMissingParameters, $configuration) . '/';
|
||||
}
|
||||
|
||||
public static function route(string $path): PageRegistration
|
||||
|
||||
@@ -23,7 +23,7 @@ class RequireTwoFactorAuthentication
|
||||
* order to perform actions. If so, we check the level at which it is required (all users
|
||||
* or just admins) and then check if the user has enabled it for their account.
|
||||
*
|
||||
* @throws \App\Exceptions\Http\TwoFactorAuthRequiredException
|
||||
* @throws TwoFactorAuthRequiredException
|
||||
*/
|
||||
public function handle(Request $request, \Closure $next): mixed
|
||||
{
|
||||
|
||||
@@ -87,7 +87,7 @@ abstract class ApplicationApiRequest extends FormRequest
|
||||
$value = $this->route()->parameter($key);
|
||||
|
||||
Assert::isInstanceOf($value, $expect);
|
||||
Assert::isInstanceOf($value, Model::class);
|
||||
Assert::isInstanceOf($value, Model::class); // @phpstan-ignore staticMethod.alreadyNarrowedType
|
||||
Assert::true($value->exists);
|
||||
|
||||
/* @var T $value */
|
||||
|
||||
@@ -8,6 +8,7 @@ use App\Services\Nodes\NodeJWTService;
|
||||
use App\Services\Servers\GetUserPermissionsService;
|
||||
use Filament\Support\Enums\IconSize;
|
||||
use Filament\Tables\View\Components\Columns\IconColumnComponent\IconComponent;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\View\ComponentAttributeBag;
|
||||
use Livewire\Attributes\Locked;
|
||||
@@ -30,7 +31,7 @@ class NodeClientConnectivity extends Component
|
||||
$this->nodeJWTService = $nodeJWTService;
|
||||
}
|
||||
|
||||
public function render(): \Illuminate\Contracts\View\View
|
||||
public function render(): View
|
||||
{
|
||||
$httpUrl = $this->node->getConnectionAddress();
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ use App\Enums\TablerIcon;
|
||||
use App\Events\ActivityLogged;
|
||||
use App\Traits\HasValidation;
|
||||
use BackedEnum;
|
||||
use Carbon\Carbon;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Support\Contracts\HasIcon;
|
||||
use Filament\Support\Contracts\HasLabel;
|
||||
@@ -17,6 +16,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Illuminate\Support\Str;
|
||||
@@ -31,28 +31,28 @@ use LogicException;
|
||||
* @property string|null $description
|
||||
* @property string|null $actor_type
|
||||
* @property int|null $actor_id
|
||||
* @property Collection<array-key, mixed> $properties
|
||||
* @property Carbon $timestamp
|
||||
* @property int|null $api_key_id
|
||||
* @property Collection|null $properties
|
||||
* @property \Carbon\Carbon $timestamp
|
||||
* @property Model|\Eloquent $actor
|
||||
* @property \Illuminate\Database\Eloquent\Collection|ActivityLogSubject[] $subjects
|
||||
* @property int|null $subjects_count
|
||||
* @property ApiKey|null $apiKey
|
||||
* @property-read Model|\Eloquent|null $actor
|
||||
* @property-read ApiKey|null $apiKey
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, ActivityLogSubject> $subjects
|
||||
* @property-read int|null $subjects_count
|
||||
*
|
||||
* @method static Builder|ActivityLog forActor(Model $actor)
|
||||
* @method static Builder|ActivityLog forEvent(string $action)
|
||||
* @method static Builder|ActivityLog newModelQuery()
|
||||
* @method static Builder|ActivityLog newQuery()
|
||||
* @method static Builder|ActivityLog query()
|
||||
* @method static Builder|ActivityLog whereActorId($value)
|
||||
* @method static Builder|ActivityLog whereActorType($value)
|
||||
* @method static Builder|ActivityLog whereApiKeyId($value)
|
||||
* @method static Builder|ActivityLog whereDescription($value)
|
||||
* @method static Builder|ActivityLog whereEvent($value)
|
||||
* @method static Builder|ActivityLog whereId($value)
|
||||
* @method static Builder|ActivityLog whereIp($value)
|
||||
* @method static Builder|ActivityLog whereProperties($value)
|
||||
* @method static Builder|ActivityLog whereTimestamp($value)
|
||||
* @method static Builder<static>|ActivityLog forActor(\Illuminate\Database\Eloquent\Model $actor)
|
||||
* @method static Builder<static>|ActivityLog forEvent(string $action)
|
||||
* @method static Builder<static>|ActivityLog newModelQuery()
|
||||
* @method static Builder<static>|ActivityLog newQuery()
|
||||
* @method static Builder<static>|ActivityLog query()
|
||||
* @method static Builder<static>|ActivityLog whereActorId($value)
|
||||
* @method static Builder<static>|ActivityLog whereActorType($value)
|
||||
* @method static Builder<static>|ActivityLog whereApiKeyId($value)
|
||||
* @method static Builder<static>|ActivityLog whereDescription($value)
|
||||
* @method static Builder<static>|ActivityLog whereEvent($value)
|
||||
* @method static Builder<static>|ActivityLog whereId($value)
|
||||
* @method static Builder<static>|ActivityLog whereIp($value)
|
||||
* @method static Builder<static>|ActivityLog whereProperties($value)
|
||||
* @method static Builder<static>|ActivityLog whereTimestamp($value)
|
||||
*/
|
||||
class ActivityLog extends Model implements HasIcon, HasLabel
|
||||
{
|
||||
|
||||
@@ -14,14 +14,18 @@ use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $activity_log_id
|
||||
* @property int $subject_id
|
||||
* @property string $subject_type
|
||||
* @property ActivityLog|null $activityLog
|
||||
* @property Model|\Eloquent $subject
|
||||
* @property int $subject_id
|
||||
* @property-read ActivityLog $activityLog
|
||||
* @property-read Model|\Eloquent $subject
|
||||
*
|
||||
* @method static Builder|ActivityLogSubject newModelQuery()
|
||||
* @method static Builder|ActivityLogSubject newQuery()
|
||||
* @method static Builder|ActivityLogSubject query()
|
||||
* @method static Builder<static>|ActivityLogSubject newModelQuery()
|
||||
* @method static Builder<static>|ActivityLogSubject newQuery()
|
||||
* @method static Builder<static>|ActivityLogSubject query()
|
||||
* @method static Builder<static>|ActivityLogSubject whereActivityLogId($value)
|
||||
* @method static Builder<static>|ActivityLogSubject whereId($value)
|
||||
* @method static Builder<static>|ActivityLogSubject whereSubjectId($value)
|
||||
* @method static Builder<static>|ActivityLogSubject whereSubjectType($value)
|
||||
*/
|
||||
class ActivityLogSubject extends Pivot
|
||||
{
|
||||
|
||||
@@ -4,13 +4,12 @@ namespace App\Models;
|
||||
|
||||
use App\Exceptions\Service\Allocation\ServerUsingAllocationException;
|
||||
use App\Traits\HasValidation;
|
||||
use Carbon\Carbon;
|
||||
use Database\Factories\AllocationFactory;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
/**
|
||||
* App\Models\Allocation.
|
||||
@@ -18,32 +17,33 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
* @property int $id
|
||||
* @property int $node_id
|
||||
* @property string $ip
|
||||
* @property string|null $ip_alias
|
||||
* @property int $port
|
||||
* @property int|null $server_id
|
||||
* @property string|null $notes
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property string $alias
|
||||
* @property bool $has_alias
|
||||
* @property string $address
|
||||
* @property Server|null $server
|
||||
* @property Node $node
|
||||
* @property string|null $ip_alias
|
||||
* @property string|null $notes
|
||||
* @property bool $is_locked
|
||||
* @property-read string $address
|
||||
* @property-read string $alias
|
||||
* @property-read bool $has_alias
|
||||
* @property-read Node $node
|
||||
* @property-read Server|null $server
|
||||
*
|
||||
* @method static AllocationFactory factory(...$parameters)
|
||||
* @method static Builder|Allocation newModelQuery()
|
||||
* @method static Builder|Allocation newQuery()
|
||||
* @method static Builder|Allocation query()
|
||||
* @method static Builder|Allocation whereCreatedAt($value)
|
||||
* @method static Builder|Allocation whereId($value)
|
||||
* @method static Builder|Allocation whereIp($value)
|
||||
* @method static Builder|Allocation whereIpAlias($value)
|
||||
* @method static Builder|Allocation whereNodeId($value)
|
||||
* @method static Builder|Allocation whereNotes($value)
|
||||
* @method static Builder|Allocation wherePort($value)
|
||||
* @method static Builder|Allocation whereServerId($value)
|
||||
* @method static Builder|Allocation whereUpdatedAt($value)
|
||||
* @method static \Database\Factories\AllocationFactory factory($count = null, $state = [])
|
||||
* @method static Builder<static>|Allocation newModelQuery()
|
||||
* @method static Builder<static>|Allocation newQuery()
|
||||
* @method static Builder<static>|Allocation query()
|
||||
* @method static Builder<static>|Allocation whereCreatedAt($value)
|
||||
* @method static Builder<static>|Allocation whereId($value)
|
||||
* @method static Builder<static>|Allocation whereIp($value)
|
||||
* @method static Builder<static>|Allocation whereIpAlias($value)
|
||||
* @method static Builder<static>|Allocation whereIsLocked($value)
|
||||
* @method static Builder<static>|Allocation whereNodeId($value)
|
||||
* @method static Builder<static>|Allocation whereNotes($value)
|
||||
* @method static Builder<static>|Allocation wherePort($value)
|
||||
* @method static Builder<static>|Allocation whereServerId($value)
|
||||
* @method static Builder<static>|Allocation whereUpdatedAt($value)
|
||||
*/
|
||||
class Allocation extends Model
|
||||
{
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace App\Models;
|
||||
|
||||
use App\Services\Acl\Api\AdminAcl;
|
||||
use App\Traits\HasValidation;
|
||||
use Database\Factories\ApiKeyFactory;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
@@ -17,41 +16,35 @@ use Webmozart\Assert\Assert;
|
||||
* App\Models\ApiKey.
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $user_id
|
||||
* @property int $key_type
|
||||
* @property string $identifier
|
||||
* @property string $token
|
||||
* @property string[]|null $permissions
|
||||
* @property string[]|null $allowed_ips
|
||||
* @property string|null $memo
|
||||
* @property Carbon|null $last_used_at
|
||||
* @property Carbon|null $expires_at
|
||||
* @property string[] $allowed_ips
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property User $tokenable
|
||||
* @property User $user
|
||||
* @property int|null $user_id
|
||||
* @property string|null $memo
|
||||
* @property string|null $identifier
|
||||
* @property int $key_type
|
||||
* @property Carbon|null $last_used_at
|
||||
* @property Carbon|null $expires_at
|
||||
* @property array<string, int> $permissions
|
||||
* @property-read User|null $user
|
||||
*
|
||||
* @method static ApiKeyFactory factory(...$parameters)
|
||||
* @method static Builder|ApiKey newModelQuery()
|
||||
* @method static Builder|ApiKey newQuery()
|
||||
* @method static Builder|ApiKey query()
|
||||
* @method static Builder|ApiKey whereAllowedIps($value)
|
||||
* @method static Builder|ApiKey whereCreatedAt($value)
|
||||
* @method static Builder|ApiKey whereId($value)
|
||||
* @method static Builder|ApiKey whereIdentifier($value)
|
||||
* @method static Builder|ApiKey whereKeyType($value)
|
||||
* @method static Builder|ApiKey whereLastUsedAt($value)
|
||||
* @method static Builder|ApiKey whereMemo($value)
|
||||
* @method static Builder|ApiKey whereRAllocations($value)
|
||||
* @method static Builder|ApiKey whereRDatabaseHosts($value)
|
||||
* @method static Builder|ApiKey whereREggs($value)
|
||||
* @method static Builder|ApiKey whereRNodes($value)
|
||||
* @method static Builder|ApiKey whereRServerDatabases($value)
|
||||
* @method static Builder|ApiKey whereRServers($value)
|
||||
* @method static Builder|ApiKey whereRUsers($value)
|
||||
* @method static Builder|ApiKey whereToken($value)
|
||||
* @method static Builder|ApiKey whereUpdatedAt($value)
|
||||
* @method static Builder|ApiKey whereUserId($value)
|
||||
* @method static \Database\Factories\ApiKeyFactory factory($count = null, $state = [])
|
||||
* @method static Builder<static>|ApiKey newModelQuery()
|
||||
* @method static Builder<static>|ApiKey newQuery()
|
||||
* @method static Builder<static>|ApiKey query()
|
||||
* @method static Builder<static>|ApiKey whereAllowedIps($value)
|
||||
* @method static Builder<static>|ApiKey whereCreatedAt($value)
|
||||
* @method static Builder<static>|ApiKey whereExpiresAt($value)
|
||||
* @method static Builder<static>|ApiKey whereId($value)
|
||||
* @method static Builder<static>|ApiKey whereIdentifier($value)
|
||||
* @method static Builder<static>|ApiKey whereKeyType($value)
|
||||
* @method static Builder<static>|ApiKey whereLastUsedAt($value)
|
||||
* @method static Builder<static>|ApiKey whereMemo($value)
|
||||
* @method static Builder<static>|ApiKey wherePermissions($value)
|
||||
* @method static Builder<static>|ApiKey whereToken($value)
|
||||
* @method static Builder<static>|ApiKey whereUpdatedAt($value)
|
||||
* @method static Builder<static>|ApiKey whereUserId($value)
|
||||
*/
|
||||
class ApiKey extends PersonalAccessToken
|
||||
{
|
||||
|
||||
@@ -18,20 +18,44 @@ use Illuminate\Database\Query\Builder;
|
||||
* @property int $id
|
||||
* @property int $server_id
|
||||
* @property string $uuid
|
||||
* @property bool $is_successful
|
||||
* @property bool $is_locked
|
||||
* @property string $name
|
||||
* @property string[] $ignored_files
|
||||
* @property string $disk
|
||||
* @property string|null $checksum
|
||||
* @property int $bytes
|
||||
* @property string|null $upload_id
|
||||
* @property CarbonImmutable|null $completed_at
|
||||
* @property BackupStatus $status
|
||||
* @property CarbonImmutable $created_at
|
||||
* @property CarbonImmutable $updated_at
|
||||
* @property CarbonImmutable|null $created_at
|
||||
* @property CarbonImmutable|null $updated_at
|
||||
* @property CarbonImmutable|null $deleted_at
|
||||
* @property Server $server
|
||||
* @property bool $is_successful
|
||||
* @property string|null $upload_id
|
||||
* @property bool $is_locked
|
||||
* @property-read Server $server
|
||||
* @property-read BackupStatus $status
|
||||
*
|
||||
* @method static \Database\Factories\BackupFactory factory($count = null, $state = [])
|
||||
* @method static BackupQueryBuilder<static>|Backup newModelQuery()
|
||||
* @method static BackupQueryBuilder<static>|Backup newQuery()
|
||||
* @method static BackupQueryBuilder<static>|Backup nonFailed()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Backup onlyTrashed()
|
||||
* @method static BackupQueryBuilder<static>|Backup query()
|
||||
* @method static BackupQueryBuilder<static>|Backup whereBytes($value)
|
||||
* @method static BackupQueryBuilder<static>|Backup whereChecksum($value)
|
||||
* @method static BackupQueryBuilder<static>|Backup whereCompletedAt($value)
|
||||
* @method static BackupQueryBuilder<static>|Backup whereCreatedAt($value)
|
||||
* @method static BackupQueryBuilder<static>|Backup whereDeletedAt($value)
|
||||
* @method static BackupQueryBuilder<static>|Backup whereDisk($value)
|
||||
* @method static BackupQueryBuilder<static>|Backup whereId($value)
|
||||
* @method static BackupQueryBuilder<static>|Backup whereIgnoredFiles($value)
|
||||
* @method static BackupQueryBuilder<static>|Backup whereIsLocked($value)
|
||||
* @method static BackupQueryBuilder<static>|Backup whereIsSuccessful($value)
|
||||
* @method static BackupQueryBuilder<static>|Backup whereName($value)
|
||||
* @method static BackupQueryBuilder<static>|Backup whereServerId($value)
|
||||
* @method static BackupQueryBuilder<static>|Backup whereUpdatedAt($value)
|
||||
* @method static BackupQueryBuilder<static>|Backup whereUploadId($value)
|
||||
* @method static BackupQueryBuilder<static>|Backup whereUuid($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Backup withTrashed(bool $withTrashed = true)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Backup withoutTrashed()
|
||||
*/
|
||||
class Backup extends Model implements Validatable
|
||||
{
|
||||
|
||||
@@ -4,11 +4,11 @@ namespace App\Models;
|
||||
|
||||
use App\Contracts\Validatable;
|
||||
use App\Traits\HasValidation;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Support\Carbon;
|
||||
use PDOException;
|
||||
|
||||
/**
|
||||
@@ -19,12 +19,27 @@ use PDOException;
|
||||
* @property string $username
|
||||
* @property string $remote
|
||||
* @property string $password
|
||||
* @property ?int $max_connections
|
||||
* @property string $jdbc
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property Server $server
|
||||
* @property DatabaseHost $host
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property int|null $max_connections
|
||||
* @property-read DatabaseHost $host
|
||||
* @property-read string $jdbc
|
||||
* @property-read Server $server
|
||||
*
|
||||
* @method static \Database\Factories\DatabaseFactory factory($count = null, $state = [])
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Database newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Database newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Database query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Database whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Database whereDatabase($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Database whereDatabaseHostId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Database whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Database whereMaxConnections($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Database wherePassword($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Database whereRemote($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Database whereServerId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Database whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Database whereUsername($value)
|
||||
*/
|
||||
class Database extends Model implements Validatable
|
||||
{
|
||||
|
||||
@@ -21,13 +21,26 @@ use Illuminate\Support\Facades\DB;
|
||||
* @property string $username
|
||||
* @property string $password
|
||||
* @property int|null $max_databases
|
||||
* @property int|null $node_id
|
||||
* @property CarbonImmutable $created_at
|
||||
* @property CarbonImmutable $updated_at
|
||||
* @property Collection|Node[] $nodes
|
||||
* @property int|null $nodes_count
|
||||
* @property Collection|Database[] $databases
|
||||
* @property int|null $databases_count
|
||||
* @property CarbonImmutable|null $created_at
|
||||
* @property CarbonImmutable|null $updated_at
|
||||
* @property-read Collection<int, Database> $databases
|
||||
* @property-read int|null $databases_count
|
||||
* @property-read Collection<int, Node> $nodes
|
||||
* @property-read int|null $nodes_count
|
||||
*
|
||||
* @method static \Database\Factories\DatabaseHostFactory factory($count = null, $state = [])
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|DatabaseHost newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|DatabaseHost newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|DatabaseHost query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|DatabaseHost whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|DatabaseHost whereHost($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|DatabaseHost whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|DatabaseHost whereMaxDatabases($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|DatabaseHost whereName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|DatabaseHost wherePassword($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|DatabaseHost wherePort($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|DatabaseHost whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|DatabaseHost whereUsername($value)
|
||||
*/
|
||||
class DatabaseHost extends Model implements Validatable
|
||||
{
|
||||
|
||||
@@ -6,57 +6,90 @@ use App\Contracts\Validatable;
|
||||
use App\Exceptions\Service\Egg\HasChildrenException;
|
||||
use App\Exceptions\Service\HasActiveServersException;
|
||||
use App\Traits\HasValidation;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property string $uuid
|
||||
* @property string $author
|
||||
* @property string $name
|
||||
* @property string|null $description
|
||||
* @property string|null $image
|
||||
* @property string[]|null $features
|
||||
* @property array<string, string> $docker_images
|
||||
* @property string|null $update_url
|
||||
* @property bool $force_outgoing_ip
|
||||
* @property string[]|null $file_denylist
|
||||
* @property string|null $config_files
|
||||
* @property string|null $config_startup
|
||||
* @property string|null $config_logs
|
||||
* @property string|null $config_stop
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property int|null $config_from
|
||||
* @property array<string, string> $startup_commands
|
||||
* @property bool $script_is_privileged
|
||||
* @property string|null $config_stop
|
||||
* @property string|null $config_logs
|
||||
* @property string|null $config_startup
|
||||
* @property string|null $config_files
|
||||
* @property string|null $script_install
|
||||
* @property bool $script_is_privileged
|
||||
* @property string $script_entry
|
||||
* @property string $script_container
|
||||
* @property int|null $copy_script_from
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property string|null $copy_script_install
|
||||
* @property string $copy_script_entry
|
||||
* @property string $copy_script_container
|
||||
* @property string|null $inherit_config_files
|
||||
* @property string|null $inherit_config_startup
|
||||
* @property string|null $inherit_config_logs
|
||||
* @property string|null $inherit_config_stop
|
||||
* @property string $inherit_file_denylist
|
||||
* @property string[]|null $inherit_features
|
||||
* @property string|null $uuid
|
||||
* @property string $author
|
||||
* @property string[]|null $features
|
||||
* @property array<string, string> $docker_images
|
||||
* @property string|null $update_url
|
||||
* @property string[]|null $file_denylist
|
||||
* @property bool $force_outgoing_ip
|
||||
* @property string[] $tags
|
||||
* @property Collection|Server[] $servers
|
||||
* @property int|null $servers_count
|
||||
* @property Collection|EggVariable[] $variables
|
||||
* @property int|null $variables_count
|
||||
* @property \App\Models\Egg|null $scriptFrom
|
||||
* @property \App\Models\Egg|null $configFrom
|
||||
* @property array<string, string> $startup_commands
|
||||
* @property-read Collection<int, Egg> $children
|
||||
* @property-read int|null $children_count
|
||||
* @property-read Egg|null $configFrom
|
||||
* @property-read string $copy_script_container
|
||||
* @property-read string $copy_script_entry
|
||||
* @property-read string|null $copy_script_install
|
||||
* @property-read string|null $image
|
||||
* @property-read string|null $inherit_config_files
|
||||
* @property-read string|null $inherit_config_logs
|
||||
* @property-read string|null $inherit_config_startup
|
||||
* @property-read string|null $inherit_config_stop
|
||||
* @property-read string[]|null $inherit_features
|
||||
* @property-read string[]|null $inherit_file_denylist
|
||||
* @property-read Collection<int, Mount> $mounts
|
||||
* @property-read int|null $mounts_count
|
||||
* @property-read Egg|null $scriptFrom
|
||||
* @property-read Collection<int, Server> $servers
|
||||
* @property-read int|null $servers_count
|
||||
* @property-read Collection<int, EggVariable> $variables
|
||||
* @property-read int|null $variables_count
|
||||
*
|
||||
* @method static \Database\Factories\EggFactory factory($count = null, $state = [])
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereAuthor($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereConfigFiles($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereConfigFrom($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereConfigLogs($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereConfigStartup($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereConfigStop($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereCopyScriptFrom($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereDescription($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereDockerImages($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereFeatures($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereFileDenylist($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereForceOutgoingIp($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereScriptContainer($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereScriptEntry($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereScriptInstall($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereScriptIsPrivileged($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereStartupCommands($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereTags($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereUpdateUrl($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Egg whereUuid($value)
|
||||
*/
|
||||
class Egg extends Model implements Validatable
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace App\Models;
|
||||
use App\Contracts\Validatable;
|
||||
use App\Traits\HasValidation;
|
||||
use Carbon\CarbonImmutable;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
@@ -13,7 +14,6 @@ use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $egg_id
|
||||
* @property null $sort
|
||||
* @property string $name
|
||||
* @property string $description
|
||||
* @property string $env_variable
|
||||
@@ -21,15 +21,32 @@ use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
* @property bool $user_viewable
|
||||
* @property bool $user_editable
|
||||
* @property string[] $rules
|
||||
* @property CarbonImmutable $created_at
|
||||
* @property CarbonImmutable $updated_at
|
||||
* @property bool $required
|
||||
* @property Egg $egg
|
||||
* @property ServerVariable $serverVariable
|
||||
* @property CarbonImmutable|null $created_at
|
||||
* @property CarbonImmutable|null $updated_at
|
||||
* @property int|null $sort
|
||||
* @property-read Egg|null $egg
|
||||
* @property-read bool $required
|
||||
* @property-read Collection<int, ServerVariable> $serverVariable
|
||||
* @property-read int|null $server_variable_count
|
||||
*
|
||||
* The "server_value" variable is only present on the object if you've loaded this model
|
||||
* using the server relationship.
|
||||
* @property string|null $server_value
|
||||
* @method static \Database\Factories\EggVariableFactory factory($count = null, $state = [])
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|EggVariable newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|EggVariable newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|EggVariable query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|EggVariable whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|EggVariable whereDefaultValue($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|EggVariable whereDescription($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|EggVariable whereEggId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|EggVariable whereEnvVariable($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|EggVariable whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|EggVariable whereName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|EggVariable whereRules($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|EggVariable whereSort($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|EggVariable whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|EggVariable whereUserEditable($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|EggVariable whereUserViewable($value)
|
||||
*
|
||||
* @property string|null $server_value This variable is only present on the object if you've loaded this model using the server relationship.
|
||||
*/
|
||||
class EggVariable extends Model implements Validatable
|
||||
{
|
||||
|
||||
@@ -6,12 +6,12 @@ use App\Enums\TablerIcon;
|
||||
use App\Livewire\AlertBanner;
|
||||
use App\Repositories\Daemon\DaemonFileRepository;
|
||||
use BackedEnum;
|
||||
use Carbon\Carbon;
|
||||
use Closure;
|
||||
use Exception;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Http\Client\ConnectionException;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Sushi\Sushi;
|
||||
|
||||
/**
|
||||
@@ -28,6 +28,21 @@ use Sushi\Sushi;
|
||||
* @property bool $is_file
|
||||
* @property bool $is_symlink
|
||||
* @property string $mime_type
|
||||
*
|
||||
* @method static Builder<static>|File newModelQuery()
|
||||
* @method static Builder<static>|File newQuery()
|
||||
* @method static Builder<static>|File query()
|
||||
* @method static Builder<static>|File whereCreatedAt($value)
|
||||
* @method static Builder<static>|File whereId($value)
|
||||
* @method static Builder<static>|File whereIsDirectory($value)
|
||||
* @method static Builder<static>|File whereIsFile($value)
|
||||
* @method static Builder<static>|File whereIsSymlink($value)
|
||||
* @method static Builder<static>|File whereMimeType($value)
|
||||
* @method static Builder<static>|File whereMode($value)
|
||||
* @method static Builder<static>|File whereModeBits($value)
|
||||
* @method static Builder<static>|File whereModifiedAt($value)
|
||||
* @method static Builder<static>|File whereName($value)
|
||||
* @method static Builder<static>|File whereSize($value)
|
||||
*/
|
||||
class File extends Model
|
||||
{
|
||||
@@ -138,6 +153,9 @@ class File extends Model
|
||||
return [
|
||||
'created_at' => 'datetime',
|
||||
'modified_at' => 'datetime',
|
||||
'is_directory' => 'boolean',
|
||||
'is_file' => 'boolean',
|
||||
'is_symlink' => 'boolean',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -12,14 +12,29 @@ use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
||||
* @property int $id
|
||||
* @property string $uuid
|
||||
* @property string $name
|
||||
* @property string $description
|
||||
* @property string|null $description
|
||||
* @property string $source
|
||||
* @property string $target
|
||||
* @property bool $read_only
|
||||
* @property bool $user_mountable
|
||||
* @property Egg[]|Collection $eggs
|
||||
* @property Node[]|Collection $nodes
|
||||
* @property Server[]|Collection $servers
|
||||
* @property-read Collection<int, Egg> $eggs
|
||||
* @property-read int|null $eggs_count
|
||||
* @property-read Collection<int, Node> $nodes
|
||||
* @property-read int|null $nodes_count
|
||||
* @property-read Collection<int, Server> $servers
|
||||
* @property-read int|null $servers_count
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Mount newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Mount newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Mount query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Mount whereDescription($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Mount whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Mount whereName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Mount whereReadOnly($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Mount whereSource($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Mount whereTarget($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Mount whereUserMountable($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Mount whereUuid($value)
|
||||
*/
|
||||
class Mount extends Model implements Validatable
|
||||
{
|
||||
|
||||
@@ -6,7 +6,6 @@ use App\Contracts\Validatable;
|
||||
use App\Exceptions\Service\HasActiveServersException;
|
||||
use App\Repositories\Daemon\DaemonSystemRepository;
|
||||
use App\Traits\HasValidation;
|
||||
use Carbon\Carbon;
|
||||
use Exception;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
@@ -15,46 +14,84 @@ use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
||||
use Illuminate\Notifications\DatabaseNotification;
|
||||
use Illuminate\Notifications\DatabaseNotificationCollection;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Str;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property string $uuid
|
||||
* @property bool $public
|
||||
* @property string $name
|
||||
* @property string|null $description
|
||||
* @property string $fqdn
|
||||
* @property string $scheme
|
||||
* @property bool $behind_proxy
|
||||
* @property bool $maintenance_mode
|
||||
* @property int $memory
|
||||
* @property int $memory_overallocate
|
||||
* @property int $disk
|
||||
* @property int $disk_overallocate
|
||||
* @property int $cpu
|
||||
* @property int $cpu_overallocate
|
||||
* @property int $upload_size
|
||||
* @property string $daemon_token_id
|
||||
* @property string $daemon_token
|
||||
* @property int $daemon_listen
|
||||
* @property int $daemon_connect
|
||||
* @property int $daemon_sftp
|
||||
* @property string|null $daemon_sftp_alias
|
||||
* @property string $daemon_base
|
||||
* @property string[] $tags
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property Mount[]|Collection $mounts
|
||||
* @property int|null $mounts_count
|
||||
* @property Server[]|Collection $servers
|
||||
* @property int|null $servers_count
|
||||
* @property Allocation[]|Collection $allocations
|
||||
* @property int|null $allocations_count
|
||||
* @property Role[]|Collection $roles
|
||||
* @property int|null $roles_count
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property int $upload_size
|
||||
* @property bool $behind_proxy
|
||||
* @property string|null $description
|
||||
* @property bool $maintenance_mode
|
||||
* @property string|null $uuid
|
||||
* @property string|null $daemon_token_id
|
||||
* @property array<array-key, mixed>|null $tags
|
||||
* @property int $cpu
|
||||
* @property int $cpu_overallocate
|
||||
* @property string|null $daemon_sftp_alias
|
||||
* @property int $daemon_connect
|
||||
* @property-read Collection<int, Allocation> $allocations
|
||||
* @property-read int|null $allocations_count
|
||||
* @property-read Collection<int, DatabaseHost> $databaseHosts
|
||||
* @property-read int|null $database_hosts_count
|
||||
* @property-read Collection<int, Mount> $mounts
|
||||
* @property-read int|null $mounts_count
|
||||
* @property-read DatabaseNotificationCollection<int, DatabaseNotification> $notifications
|
||||
* @property-read int|null $notifications_count
|
||||
* @property-read Collection<int, Role> $roles
|
||||
* @property-read int|null $roles_count
|
||||
* @property-read Collection<int, Server> $servers
|
||||
* @property-read int|null $servers_count
|
||||
*
|
||||
* @method static \Database\Factories\NodeFactory factory($count = null, $state = [])
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereBehindProxy($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereCpu($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereCpuOverallocate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereDaemonBase($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereDaemonConnect($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereDaemonListen($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereDaemonSftp($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereDaemonSftpAlias($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereDaemonToken($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereDaemonTokenId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereDescription($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereDisk($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereDiskOverallocate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereFqdn($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereMaintenanceMode($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereMemory($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereMemoryOverallocate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node wherePublic($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereScheme($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereTags($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereUploadSize($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Node whereUuid($value)
|
||||
*/
|
||||
class Node extends Model implements Validatable
|
||||
{
|
||||
|
||||
@@ -4,6 +4,16 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Relations\Pivot;
|
||||
|
||||
/**
|
||||
* @property int $node_id
|
||||
* @property int $role_id
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|NodeRole newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|NodeRole newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|NodeRole query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|NodeRole whereNodeId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|NodeRole whereRoleId($value)
|
||||
*/
|
||||
class NodeRole extends Pivot
|
||||
{
|
||||
protected $table = 'node_role';
|
||||
|
||||
@@ -34,6 +34,26 @@ use Sushi\Sushi;
|
||||
* @property PluginStatus $status
|
||||
* @property string|null $status_message
|
||||
* @property int $load_order
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Plugin newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Plugin newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Plugin query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Plugin whereAuthor($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Plugin whereCategory($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Plugin whereClass($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Plugin whereComposerPackages($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Plugin whereDescription($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Plugin whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Plugin whereLoadOrder($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Plugin whereName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Plugin whereNamespace($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Plugin wherePanelVersion($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Plugin wherePanels($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Plugin whereStatus($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Plugin whereStatusMessage($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Plugin whereUpdateUrl($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Plugin whereUrl($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Plugin whereVersion($value)
|
||||
*/
|
||||
class Plugin extends Model implements HasPluginSettings
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ use BackedEnum;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Spatie\Permission\Models\Permission;
|
||||
use Spatie\Permission\Models\Role as BaseRole;
|
||||
|
||||
@@ -16,12 +17,27 @@ use Spatie\Permission\Models\Role as BaseRole;
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $guard_name
|
||||
* @property Collection|Permission[] $permissions
|
||||
* @property int|null $permissions_count
|
||||
* @property Collection|User[] $users
|
||||
* @property int|null $users_count
|
||||
* @property Collection|Node[] $nodes
|
||||
* @property int|null $nodes_count
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property-read NodeRole|null $pivot
|
||||
* @property-read Collection<int, Node> $nodes
|
||||
* @property-read int|null $nodes_count
|
||||
* @property-read Collection<int, Permission> $permissions
|
||||
* @property-read int|null $permissions_count
|
||||
* @property-read Collection<int, User> $users
|
||||
* @property-read int|null $users_count
|
||||
*
|
||||
* @method static \Database\Factories\RoleFactory factory($count = null, $state = [])
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Role newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Role newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Role permission($permissions, $without = false)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Role query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Role whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Role whereGuardName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Role whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Role whereName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Role whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Role withoutPermission($permissions)
|
||||
*/
|
||||
class Role extends BaseRole
|
||||
{
|
||||
|
||||
@@ -6,34 +6,55 @@ use App\Contracts\Validatable;
|
||||
use App\Enums\ScheduleStatus;
|
||||
use App\Helpers\Utilities;
|
||||
use App\Traits\HasValidation;
|
||||
use Carbon\Carbon;
|
||||
use Exception;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $server_id
|
||||
* @property string $name
|
||||
* @property string $cron_day_of_week
|
||||
* @property string $cron_month
|
||||
* @property string $cron_day_of_month
|
||||
* @property string $cron_hour
|
||||
* @property string $cron_minute
|
||||
* @property bool $is_active
|
||||
* @property bool $is_processing
|
||||
* @property bool $only_when_online
|
||||
* @property Carbon|null $last_run_at
|
||||
* @property Carbon|null $next_run_at
|
||||
* @property ScheduleStatus $status
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property Server $server
|
||||
* @property Task[]|Collection $tasks
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property string $cron_month
|
||||
* @property bool $only_when_online
|
||||
* @property-read Server $server
|
||||
* @property-read ScheduleStatus $status
|
||||
* @property-read Collection<int, Task> $tasks
|
||||
* @property-read int|null $tasks_count
|
||||
*
|
||||
* @method static \Database\Factories\ScheduleFactory factory($count = null, $state = [])
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Schedule newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Schedule newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Schedule query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Schedule whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Schedule whereCronDayOfMonth($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Schedule whereCronDayOfWeek($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Schedule whereCronHour($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Schedule whereCronMinute($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Schedule whereCronMonth($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Schedule whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Schedule whereIsActive($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Schedule whereIsProcessing($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Schedule whereLastRunAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Schedule whereName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Schedule whereNextRunAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Schedule whereOnlyWhenOnline($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Schedule whereServerId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Schedule whereUpdatedAt($value)
|
||||
*/
|
||||
class Schedule extends Model implements Validatable
|
||||
{
|
||||
|
||||
@@ -11,7 +11,6 @@ use App\Repositories\Daemon\DaemonServerRepository;
|
||||
use App\Services\Subusers\SubuserDeletionService;
|
||||
use App\Traits\HasValidation;
|
||||
use Carbon\CarbonInterface;
|
||||
use Database\Factories\ServerFactory;
|
||||
use Filament\Models\Contracts\HasAvatar;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
@@ -37,100 +36,95 @@ use Psr\Http\Message\ResponseInterface;
|
||||
* \App\Models\Server.
|
||||
*
|
||||
* @property int $id
|
||||
* @property string|null $external_id
|
||||
* @property string $uuid
|
||||
* @property string $uuid_short
|
||||
* @property int $node_id
|
||||
* @property string $name
|
||||
* @property string $description
|
||||
* @property ServerState|null $status
|
||||
* @property bool $skip_scripts
|
||||
* @property int $owner_id
|
||||
* @property int $memory
|
||||
* @property int $swap
|
||||
* @property int $disk
|
||||
* @property int $io
|
||||
* @property int $cpu
|
||||
* @property string|null $threads
|
||||
* @property bool $oom_killer
|
||||
* @property int|null $allocation_id
|
||||
* @property int $egg_id
|
||||
* @property string $startup
|
||||
* @property string $image
|
||||
* @property string|null $icon
|
||||
* @property int|null $allocation_limit
|
||||
* @property int|null $database_limit
|
||||
* @property int|null $backup_limit
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property int|null $allocation_id
|
||||
* @property string $image
|
||||
* @property string|null $description
|
||||
* @property bool $skip_scripts
|
||||
* @property string|null $external_id
|
||||
* @property int|null $database_limit
|
||||
* @property int|null $allocation_limit
|
||||
* @property string|null $threads
|
||||
* @property int $backup_limit
|
||||
* @property ServerState|null $status
|
||||
* @property Carbon|null $installed_at
|
||||
* @property Collection|ActivityLog[] $activity
|
||||
* @property int|null $activity_count
|
||||
* @property Allocation|null $allocation
|
||||
* @property Collection|Allocation[] $allocations
|
||||
* @property int|null $allocations_count
|
||||
* @property Collection|Backup[] $backups
|
||||
* @property int|null $backups_count
|
||||
* @property Collection|Database[] $databases
|
||||
* @property int|null $databases_count
|
||||
* @property Egg $egg
|
||||
* @property Collection|Mount[] $mounts
|
||||
* @property int|null $mounts_count
|
||||
* @property Node $node
|
||||
* @property DatabaseNotificationCollection|DatabaseNotification[] $notifications
|
||||
* @property int|null $notifications_count
|
||||
* @property Collection|Schedule[] $schedules
|
||||
* @property int|null $schedules_count
|
||||
* @property Collection|Subuser[] $subusers
|
||||
* @property int|null $subusers_count
|
||||
* @property ServerTransfer|null $transfer
|
||||
* @property User $user
|
||||
* @property Collection|EggVariable[] $variables
|
||||
* @property int|null $variables_count
|
||||
*
|
||||
* @method static ServerFactory factory(...$parameters)
|
||||
* @method static Builder|Server newModelQuery()
|
||||
* @method static Builder|Server newQuery()
|
||||
* @method static Builder|Server query()
|
||||
* @method static Builder|Server whereAllocationId($value)
|
||||
* @method static Builder|Server whereAllocationLimit($value)
|
||||
* @method static Builder|Server whereBackupLimit($value)
|
||||
* @method static Builder|Server whereCpu($value)
|
||||
* @method static Builder|Server whereCreatedAt($value)
|
||||
* @method static Builder|Server whereDatabaseLimit($value)
|
||||
* @method static Builder|Server whereDescription($value)
|
||||
* @method static Builder|Server whereDisk($value)
|
||||
* @method static Builder|Server whereEggId($value)
|
||||
* @method static Builder|Server whereExternalId($value)
|
||||
* @method static Builder|Server whereId($value)
|
||||
* @method static Builder|Server whereImage($value)
|
||||
* @method static Builder|Server whereIo($value)
|
||||
* @method static Builder|Server whereMemory($value)
|
||||
* @method static Builder|Server whereName($value)
|
||||
* @method static Builder|Server whereNodeId($value)
|
||||
* @method static Builder|Server whereOomKiller($value)
|
||||
* @method static Builder|Server whereOwnerId($value)
|
||||
* @method static Builder|Server whereSkipScripts($value)
|
||||
* @method static Builder|Server whereStartup($value)
|
||||
* @method static Builder|Server whereStatus($value)
|
||||
* @method static Builder|Server whereSwap($value)
|
||||
* @method static Builder|Server whereThreads($value)
|
||||
* @method static Builder|Server whereUpdatedAt($value)
|
||||
* @method static Builder|Server whereUuid($value)
|
||||
* @method static Builder|Server whereuuid_short($value)
|
||||
*
|
||||
* @property string[]|null $docker_labels
|
||||
* @property string|null $ports
|
||||
* @property-read ContainerStatus|ServerState $condition
|
||||
* @property bool $oom_killer
|
||||
* @property array<array-key, mixed>|null $docker_labels
|
||||
* @property-read Collection<int, ActivityLog> $activity
|
||||
* @property-read int|null $activity_count
|
||||
* @property-read Allocation|null $allocation
|
||||
* @property-read Collection<int, Allocation> $allocations
|
||||
* @property-read int|null $allocations_count
|
||||
* @property-read Collection<int, Backup> $backups
|
||||
* @property-read int|null $backups_count
|
||||
* @property-read ServerState|ContainerStatus $condition
|
||||
* @property-read Collection<int, Database> $databases
|
||||
* @property-read int|null $databases_count
|
||||
* @property-read Egg $egg
|
||||
* @property-read Collection<int, EggVariable> $eggVariables
|
||||
* @property-read int|null $egg_variables_count
|
||||
* @property-read string|null $icon
|
||||
* @property-read Collection<int, Mount> $mounts
|
||||
* @property-read int|null $mounts_count
|
||||
* @property-read Node $node
|
||||
* @property-read DatabaseNotificationCollection<int, DatabaseNotification> $notifications
|
||||
* @property-read int|null $notifications_count
|
||||
* @property-read Collection<int, Schedule> $schedules
|
||||
* @property-read int|null $schedules_count
|
||||
* @property-read Collection<int, ServerVariable> $serverVariables
|
||||
* @property-read int|null $server_variables_count
|
||||
* @property-read Collection<int, Subuser> $subusers
|
||||
* @property-read int|null $subusers_count
|
||||
* @property-read ServerTransfer|null $transfer
|
||||
* @property-read User $user
|
||||
* @property-read Collection<int, EggVariable> $variables
|
||||
* @property-read int|null $variables_count
|
||||
*
|
||||
* @method static Builder|Server whereDockerLabels($value)
|
||||
* @method static Builder|Server whereInstalledAt($value)
|
||||
* @method static Builder|Server wherePorts($value)
|
||||
* @method static Builder|Server whereUuidShort($value)
|
||||
* @method static \Database\Factories\ServerFactory factory($count = null, $state = [])
|
||||
* @method static Builder<static>|Server newModelQuery()
|
||||
* @method static Builder<static>|Server newQuery()
|
||||
* @method static Builder<static>|Server query()
|
||||
* @method static Builder<static>|Server whereAllocationId($value)
|
||||
* @method static Builder<static>|Server whereAllocationLimit($value)
|
||||
* @method static Builder<static>|Server whereBackupLimit($value)
|
||||
* @method static Builder<static>|Server whereCpu($value)
|
||||
* @method static Builder<static>|Server whereCreatedAt($value)
|
||||
* @method static Builder<static>|Server whereDatabaseLimit($value)
|
||||
* @method static Builder<static>|Server whereDescription($value)
|
||||
* @method static Builder<static>|Server whereDisk($value)
|
||||
* @method static Builder<static>|Server whereDockerLabels($value)
|
||||
* @method static Builder<static>|Server whereEggId($value)
|
||||
* @method static Builder<static>|Server whereExternalId($value)
|
||||
* @method static Builder<static>|Server whereId($value)
|
||||
* @method static Builder<static>|Server whereImage($value)
|
||||
* @method static Builder<static>|Server whereInstalledAt($value)
|
||||
* @method static Builder<static>|Server whereIo($value)
|
||||
* @method static Builder<static>|Server whereMemory($value)
|
||||
* @method static Builder<static>|Server whereName($value)
|
||||
* @method static Builder<static>|Server whereNodeId($value)
|
||||
* @method static Builder<static>|Server whereOomKiller($value)
|
||||
* @method static Builder<static>|Server whereOwnerId($value)
|
||||
* @method static Builder<static>|Server whereSkipScripts($value)
|
||||
* @method static Builder<static>|Server whereStartup($value)
|
||||
* @method static Builder<static>|Server whereStatus($value)
|
||||
* @method static Builder<static>|Server whereSwap($value)
|
||||
* @method static Builder<static>|Server whereThreads($value)
|
||||
* @method static Builder<static>|Server whereUpdatedAt($value)
|
||||
* @method static Builder<static>|Server whereUuid($value)
|
||||
* @method static Builder<static>|Server whereUuidShort($value)
|
||||
*/
|
||||
class Server extends Model implements HasAvatar, Validatable
|
||||
{
|
||||
|
||||
@@ -4,27 +4,43 @@ namespace App\Models;
|
||||
|
||||
use App\Contracts\Validatable;
|
||||
use App\Traits\HasValidation;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $server_id
|
||||
* @property bool|null $successful
|
||||
* @property int $old_node
|
||||
* @property int $new_node
|
||||
* @property int|null $old_allocation
|
||||
* @property int|null $new_allocation
|
||||
* @property array<int>|null $old_additional_allocations array of allocation.id's
|
||||
* @property array<int>|null $new_additional_allocations array of allocation.id's
|
||||
* @property bool|null $successful
|
||||
* @property int[]|null $old_additional_allocations
|
||||
* @property int[]|null $new_additional_allocations
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property bool $archived
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property Server $server
|
||||
* @property Node $oldNode
|
||||
* @property Node $newNode
|
||||
* @property-read Node|null $newNode
|
||||
* @property-read Node|null $oldNode
|
||||
* @property-read Server $server
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerTransfer newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerTransfer newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerTransfer query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerTransfer whereArchived($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerTransfer whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerTransfer whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerTransfer whereNewAdditionalAllocations($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerTransfer whereNewAllocation($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerTransfer whereNewNode($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerTransfer whereOldAdditionalAllocations($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerTransfer whereOldAllocation($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerTransfer whereOldNode($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerTransfer whereServerId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerTransfer whereSuccessful($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerTransfer whereUpdatedAt($value)
|
||||
*/
|
||||
class ServerTransfer extends Model implements Validatable
|
||||
{
|
||||
|
||||
@@ -15,8 +15,18 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
* @property string $variable_value
|
||||
* @property CarbonImmutable|null $created_at
|
||||
* @property CarbonImmutable|null $updated_at
|
||||
* @property EggVariable $variable
|
||||
* @property Server $server
|
||||
* @property-read Server $server
|
||||
* @property-read EggVariable $variable
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerVariable newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerVariable newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerVariable query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerVariable whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerVariable whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerVariable whereServerId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerVariable whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerVariable whereVariableId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ServerVariable whereVariableValue($value)
|
||||
*/
|
||||
class ServerVariable extends Model implements Validatable
|
||||
{
|
||||
|
||||
@@ -5,21 +5,32 @@ namespace App\Models;
|
||||
use App\Contracts\Validatable;
|
||||
use App\Enums\SubuserPermission;
|
||||
use App\Traits\HasValidation;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $user_id
|
||||
* @property int $server_id
|
||||
* @property string[] $permissions
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property User $user
|
||||
* @property Server $server
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property string[]|null $permissions
|
||||
* @property-read Server $server
|
||||
* @property-read User $user
|
||||
*
|
||||
* @method static \Database\Factories\SubuserFactory factory($count = null, $state = [])
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Subuser newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Subuser newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Subuser query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Subuser whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Subuser whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Subuser wherePermissions($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Subuser whereServerId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Subuser whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Subuser whereUserId($value)
|
||||
*/
|
||||
class Subuser extends Model implements Validatable
|
||||
{
|
||||
|
||||
@@ -6,11 +6,11 @@ use App\Contracts\Validatable;
|
||||
use App\Extensions\Tasks\TaskSchemaInterface;
|
||||
use App\Extensions\Tasks\TaskService;
|
||||
use App\Traits\HasValidation;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOneThrough;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
@@ -20,11 +20,26 @@ use Illuminate\Database\Eloquent\Relations\HasOneThrough;
|
||||
* @property string $payload
|
||||
* @property int $time_offset
|
||||
* @property bool $is_queued
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property bool $continue_on_failure
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property Schedule $schedule
|
||||
* @property Server $server
|
||||
* @property-read Schedule $schedule
|
||||
* @property-read Server|null $server
|
||||
*
|
||||
* @method static \Database\Factories\TaskFactory factory($count = null, $state = [])
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Task newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Task newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Task query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Task whereAction($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Task whereContinueOnFailure($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Task whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Task whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Task whereIsQueued($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Task wherePayload($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Task whereScheduleId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Task whereSequenceId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Task whereTimeOffset($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Task whereUpdatedAt($value)
|
||||
*/
|
||||
class Task extends Model implements Validatable
|
||||
{
|
||||
|
||||
@@ -4,13 +4,14 @@ namespace App\Models\Traits;
|
||||
|
||||
use App\Extensions\Laravel\Sanctum\NewAccessToken;
|
||||
use App\Models\ApiKey;
|
||||
use App\Models\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Support\Str;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
|
||||
/**
|
||||
* @mixin \App\Models\Model
|
||||
* @mixin Model
|
||||
*/
|
||||
trait HasAccessTokens
|
||||
{
|
||||
|
||||
@@ -10,7 +10,6 @@ use App\Extensions\Avatar\AvatarService;
|
||||
use App\Models\Traits\HasAccessTokens;
|
||||
use App\Traits\HasValidation;
|
||||
use BackedEnum;
|
||||
use Database\Factories\UserFactory;
|
||||
use DateTimeZone;
|
||||
use Filament\Auth\MultiFactor\App\Contracts\HasAppAuthentication;
|
||||
use Filament\Auth\MultiFactor\App\Contracts\HasAppAuthenticationRecovery;
|
||||
@@ -43,56 +42,75 @@ use Illuminate\Support\Facades\Context;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Validation\Rules\In;
|
||||
use ResourceBundle;
|
||||
use Spatie\Permission\Models\Permission;
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
|
||||
/**
|
||||
* App\Models\User.
|
||||
*
|
||||
* @property int $id
|
||||
* @property string|null $external_id
|
||||
* @property bool $is_managed_externally
|
||||
* @property string $uuid
|
||||
* @property string $username
|
||||
* @property string $email
|
||||
* @property string $password
|
||||
* @property string|null $remember_token
|
||||
* @property string $language
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property string $username
|
||||
* @property string|null $external_id
|
||||
* @property string $timezone
|
||||
* @property string[]|null $oauth
|
||||
* @property array<string, mixed>|null $oauth
|
||||
* @property string|array<string, mixed>|null $customization
|
||||
* @property string|null $mfa_app_secret
|
||||
* @property string[]|null $mfa_app_recovery_codes
|
||||
* @property bool $mfa_email_enabled
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property \Illuminate\Database\Eloquent\Collection|ApiKey[] $apiKeys
|
||||
* @property int|null $api_keys_count
|
||||
* @property DatabaseNotificationCollection|DatabaseNotification[] $notifications
|
||||
* @property int|null $notifications_count
|
||||
* @property \Illuminate\Database\Eloquent\Collection|Server[] $servers
|
||||
* @property int|null $servers_count
|
||||
* @property \Illuminate\Database\Eloquent\Collection|UserSSHKey[] $sshKeys
|
||||
* @property int|null $ssh_keys_count
|
||||
* @property \Illuminate\Database\Eloquent\Collection|ApiKey[] $tokens
|
||||
* @property int|null $tokens_count
|
||||
* @property \Illuminate\Database\Eloquent\Collection|Role[] $roles
|
||||
* @property int|null $roles_count
|
||||
* @property string|array<string, mixed>|null $customization
|
||||
* @property bool $is_managed_externally
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, ActivityLog> $activity
|
||||
* @property-read int|null $activity_count
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, ApiKey> $apiKeys
|
||||
* @property-read int|null $api_keys_count
|
||||
* @property-read DatabaseNotificationCollection<int, DatabaseNotification> $notifications
|
||||
* @property-read int|null $notifications_count
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Permission> $permissions
|
||||
* @property-read int|null $permissions_count
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Role> $roles
|
||||
* @property-read int|null $roles_count
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Server> $servers
|
||||
* @property-read int|null $servers_count
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, UserSSHKey> $sshKeys
|
||||
* @property-read int|null $ssh_keys_count
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Server> $subServers
|
||||
* @property-read int|null $sub_servers_count
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Subuser> $subusers
|
||||
* @property-read int|null $subusers_count
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, ApiKey> $tokens
|
||||
* @property-read int|null $tokens_count
|
||||
*
|
||||
* @method static UserFactory factory(...$parameters)
|
||||
* @method static Builder|User newModelQuery()
|
||||
* @method static Builder|User newQuery()
|
||||
* @method static Builder|User query()
|
||||
* @method static Builder|User whereCreatedAt($value)
|
||||
* @method static Builder|User whereEmail($value)
|
||||
* @method static Builder|User whereExternalId($value)
|
||||
* @method static Builder|User whereId($value)
|
||||
* @method static Builder|User whereLanguage($value)
|
||||
* @method static Builder|User whereTimezone($value)
|
||||
* @method static Builder|User wherePassword($value)
|
||||
* @method static Builder|User whereRememberToken($value)
|
||||
* @method static Builder|User whereUpdatedAt($value)
|
||||
* @method static Builder|User whereUsername($value)
|
||||
* @method static Builder|User whereUuid($value)
|
||||
* @method static \Database\Factories\UserFactory factory($count = null, $state = [])
|
||||
* @method static Builder<static>|User newModelQuery()
|
||||
* @method static Builder<static>|User newQuery()
|
||||
* @method static Builder<static>|User permission($permissions, $without = false)
|
||||
* @method static Builder<static>|User query()
|
||||
* @method static Builder<static>|User role($roles, $guard = null, $without = false)
|
||||
* @method static Builder<static>|User whereCreatedAt($value)
|
||||
* @method static Builder<static>|User whereCustomization($value)
|
||||
* @method static Builder<static>|User whereEmail($value)
|
||||
* @method static Builder<static>|User whereExternalId($value)
|
||||
* @method static Builder<static>|User whereId($value)
|
||||
* @method static Builder<static>|User whereIsManagedExternally($value)
|
||||
* @method static Builder<static>|User whereLanguage($value)
|
||||
* @method static Builder<static>|User whereMfaAppRecoveryCodes($value)
|
||||
* @method static Builder<static>|User whereMfaAppSecret($value)
|
||||
* @method static Builder<static>|User whereMfaEmailEnabled($value)
|
||||
* @method static Builder<static>|User whereOauth($value)
|
||||
* @method static Builder<static>|User wherePassword($value)
|
||||
* @method static Builder<static>|User whereRememberToken($value)
|
||||
* @method static Builder<static>|User whereTimezone($value)
|
||||
* @method static Builder<static>|User whereUpdatedAt($value)
|
||||
* @method static Builder<static>|User whereUsername($value)
|
||||
* @method static Builder<static>|User whereUuid($value)
|
||||
* @method static Builder<static>|User withoutPermission($permissions)
|
||||
* @method static Builder<static>|User withoutRole($roles, $guard = null)
|
||||
*/
|
||||
class User extends Model implements AuthenticatableContract, AuthorizableContract, CanResetPasswordContract, FilamentUser, HasAppAuthentication, HasAppAuthenticationRecovery, HasAvatar, HasEmailAuthentication, HasName, HasTenants, Validatable
|
||||
{
|
||||
@@ -183,6 +201,7 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
|
||||
'is_managed_externally' => 'boolean',
|
||||
'mfa_app_secret' => 'encrypted',
|
||||
'mfa_app_recovery_codes' => 'encrypted:array',
|
||||
'mfa_email_enabled' => 'boolean',
|
||||
'oauth' => 'array',
|
||||
'customization' => 'array',
|
||||
];
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace App\Models;
|
||||
|
||||
use App\Traits\HasValidation;
|
||||
use Database\Factories\UserSSHKeyFactory;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -22,23 +21,23 @@ use Illuminate\Support\Carbon;
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property Carbon|null $deleted_at
|
||||
* @property User $user
|
||||
* @property-read User $user
|
||||
*
|
||||
* @method static Builder|UserSSHKey newModelQuery()
|
||||
* @method static Builder|UserSSHKey newQuery()
|
||||
* @method static \Illuminate\Database\Query\Builder|UserSSHKey onlyTrashed()
|
||||
* @method static Builder|UserSSHKey query()
|
||||
* @method static Builder|UserSSHKey whereCreatedAt($value)
|
||||
* @method static Builder|UserSSHKey whereDeletedAt($value)
|
||||
* @method static Builder|UserSSHKey whereFingerprint($value)
|
||||
* @method static Builder|UserSSHKey whereId($value)
|
||||
* @method static Builder|UserSSHKey whereName($value)
|
||||
* @method static Builder|UserSSHKey wherePublicKey($value)
|
||||
* @method static Builder|UserSSHKey whereUpdatedAt($value)
|
||||
* @method static Builder|UserSSHKey whereUserId($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|UserSSHKey withTrashed()
|
||||
* @method static \Illuminate\Database\Query\Builder|UserSSHKey withoutTrashed()
|
||||
* @method static UserSSHKeyFactory factory(...$parameters)
|
||||
* @method static \Database\Factories\UserSSHKeyFactory factory($count = null, $state = [])
|
||||
* @method static Builder<static>|UserSSHKey newModelQuery()
|
||||
* @method static Builder<static>|UserSSHKey newQuery()
|
||||
* @method static Builder<static>|UserSSHKey onlyTrashed()
|
||||
* @method static Builder<static>|UserSSHKey query()
|
||||
* @method static Builder<static>|UserSSHKey whereCreatedAt($value)
|
||||
* @method static Builder<static>|UserSSHKey whereDeletedAt($value)
|
||||
* @method static Builder<static>|UserSSHKey whereFingerprint($value)
|
||||
* @method static Builder<static>|UserSSHKey whereId($value)
|
||||
* @method static Builder<static>|UserSSHKey whereName($value)
|
||||
* @method static Builder<static>|UserSSHKey wherePublicKey($value)
|
||||
* @method static Builder<static>|UserSSHKey whereUpdatedAt($value)
|
||||
* @method static Builder<static>|UserSSHKey whereUserId($value)
|
||||
* @method static Builder<static>|UserSSHKey withTrashed(bool $withTrashed = true)
|
||||
* @method static Builder<static>|UserSSHKey withoutTrashed()
|
||||
*/
|
||||
class UserSSHKey extends Model
|
||||
{
|
||||
|
||||
@@ -2,19 +2,33 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\MassPrunable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $webhook_configuration_id
|
||||
* @property string $event
|
||||
* @property string $endpoint
|
||||
* @property \Illuminate\Support\Carbon|null $successful_at
|
||||
* @property Carbon|null $successful_at
|
||||
* @property array<array-key, mixed> $payload
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
*
|
||||
* @method static Builder<static>|Webhook newModelQuery()
|
||||
* @method static Builder<static>|Webhook newQuery()
|
||||
* @method static Builder<static>|Webhook query()
|
||||
* @method static Builder<static>|Webhook whereCreatedAt($value)
|
||||
* @method static Builder<static>|Webhook whereEndpoint($value)
|
||||
* @method static Builder<static>|Webhook whereEvent($value)
|
||||
* @method static Builder<static>|Webhook whereId($value)
|
||||
* @method static Builder<static>|Webhook wherePayload($value)
|
||||
* @method static Builder<static>|Webhook whereSuccessfulAt($value)
|
||||
* @method static Builder<static>|Webhook whereUpdatedAt($value)
|
||||
* @method static Builder<static>|Webhook whereWebhookConfigurationId($value)
|
||||
*/
|
||||
class Webhook extends Model
|
||||
{
|
||||
|
||||
@@ -14,15 +14,36 @@ use Illuminate\Support\Facades\File;
|
||||
use Livewire\Features\SupportEvents\HandlesEvents;
|
||||
|
||||
/**
|
||||
* @property string|array<string, mixed>|null $payload
|
||||
* @property int $id
|
||||
* @property string $endpoint
|
||||
* @property string $description
|
||||
* @property string[] $events
|
||||
* @property WebhookType|string|null $type
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property Carbon|null $deleted_at
|
||||
* @property array<string, string>|null $headers
|
||||
* @property WebhookType|null $type
|
||||
* @property string|array<array-key, mixed>|null $payload
|
||||
* @property array<array-key, mixed>|null $headers
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Webhook> $webhooks
|
||||
* @property-read int|null $webhooks_count
|
||||
*
|
||||
* @method static \Database\Factories\WebhookConfigurationFactory factory($count = null, $state = [])
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|WebhookConfiguration newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|WebhookConfiguration newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|WebhookConfiguration onlyTrashed()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|WebhookConfiguration query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|WebhookConfiguration whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|WebhookConfiguration whereDeletedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|WebhookConfiguration whereDescription($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|WebhookConfiguration whereEndpoint($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|WebhookConfiguration whereEvents($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|WebhookConfiguration whereHeaders($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|WebhookConfiguration whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|WebhookConfiguration wherePayload($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|WebhookConfiguration whereType($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|WebhookConfiguration whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|WebhookConfiguration withTrashed(bool $withTrashed = true)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|WebhookConfiguration withoutTrashed()
|
||||
*/
|
||||
class WebhookConfiguration extends Model
|
||||
{
|
||||
|
||||
@@ -10,6 +10,7 @@ use App\Checks\NodeVersionsCheck;
|
||||
use App\Checks\PanelVersionCheck;
|
||||
use App\Checks\ScheduleCheck;
|
||||
use App\Checks\UsedDiskSpaceCheck;
|
||||
use App\Http\Responses\LoginResponse;
|
||||
use App\Models\Allocation;
|
||||
use App\Models\ApiKey;
|
||||
use App\Models\Backup;
|
||||
@@ -126,7 +127,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->bind(LoginResponseContract::class, \App\Http\Responses\LoginResponse::class);
|
||||
$this->app->bind(LoginResponseContract::class, LoginResponse::class);
|
||||
|
||||
Scramble::ignoreDefaultRoutes();
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class DatabaseManagementService
|
||||
* The regex used to validate that the database name passed through to the function is
|
||||
* in the expected format.
|
||||
*
|
||||
* @see \App\Services\Databases\DatabaseManagementService::generateUniqueDatabaseName()
|
||||
* @see DatabaseManagementService::generateUniqueDatabaseName()
|
||||
*/
|
||||
private const MATCH_NAME_REGEX = '/^(s[\d]+_)(.*)$/';
|
||||
|
||||
@@ -136,7 +136,7 @@ class DatabaseManagementService
|
||||
/**
|
||||
* Updates a password for a given database.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function rotatePassword(Database $database): void
|
||||
{
|
||||
|
||||
@@ -348,8 +348,7 @@ class PluginService
|
||||
|
||||
$this->manageComposerPackages(oldPackages: $pluginPackages);
|
||||
|
||||
// This throws an error when not called with qualifier
|
||||
foreach (\Filament\Facades\Filament::getPanels() as $panel) {
|
||||
foreach (Filament::getPanels() as $panel) {
|
||||
$panel->clearCachedComponents();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
if (!function_exists('is_digit')) {
|
||||
/**
|
||||
* Deal with normal (and irritating) PHP behavior to determine if
|
||||
@@ -152,7 +154,7 @@ if (!function_exists('convert_to_utf8')) {
|
||||
}
|
||||
|
||||
if (!function_exists('user')) {
|
||||
function user(): ?App\Models\User
|
||||
function user(): ?User
|
||||
{
|
||||
return auth(config('auth.defaults.guard', 'web'))->user();
|
||||
}
|
||||
|
||||
@@ -1,8 +1,24 @@
|
||||
<?php
|
||||
|
||||
use App\Console\Kernel;
|
||||
use App\Exceptions\Handler;
|
||||
use App\Http\Middleware\Activity\TrackAPIKey;
|
||||
use App\Http\Middleware\Api\Application\AuthenticateApplicationUser;
|
||||
use App\Http\Middleware\Api\AuthenticateIPAccess;
|
||||
use App\Http\Middleware\Api\Client\RequireClientApiKey;
|
||||
use App\Http\Middleware\Api\Daemon\DaemonAuthenticate;
|
||||
use App\Http\Middleware\Api\IsValidJson;
|
||||
use App\Http\Middleware\EnsureStatefulRequests;
|
||||
use App\Http\Middleware\LanguageMiddleware;
|
||||
use App\Http\Middleware\MaintenanceMiddleware;
|
||||
use App\Http\Middleware\RedirectIfAuthenticated;
|
||||
use App\Http\Middleware\VerifyCsrfToken;
|
||||
use Illuminate\Contracts\Debug\ExceptionHandler;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Foundation\Configuration\Exceptions;
|
||||
use Illuminate\Foundation\Configuration\Middleware;
|
||||
use Illuminate\Foundation\Http\Middleware\ValidateCsrfToken;
|
||||
use Illuminate\Routing\Middleware\SubstituteBindings;
|
||||
|
||||
return Application::configure(basePath: dirname(__DIR__))
|
||||
->withProviders()
|
||||
@@ -12,46 +28,46 @@ return Application::configure(basePath: dirname(__DIR__))
|
||||
->withMiddleware(function (Middleware $middleware) {
|
||||
$middleware->redirectGuestsTo(fn () => route('filament.app.auth.login'));
|
||||
|
||||
$middleware->web(\App\Http\Middleware\LanguageMiddleware::class);
|
||||
$middleware->web(LanguageMiddleware::class);
|
||||
|
||||
$middleware->api([
|
||||
\App\Http\Middleware\EnsureStatefulRequests::class,
|
||||
EnsureStatefulRequests::class,
|
||||
'auth:sanctum',
|
||||
\App\Http\Middleware\Api\IsValidJson::class,
|
||||
\App\Http\Middleware\Activity\TrackAPIKey::class,
|
||||
\App\Http\Middleware\Api\AuthenticateIPAccess::class,
|
||||
IsValidJson::class,
|
||||
TrackAPIKey::class,
|
||||
AuthenticateIPAccess::class,
|
||||
]);
|
||||
|
||||
$middleware->group('application-api', [
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
\App\Http\Middleware\Api\Application\AuthenticateApplicationUser::class,
|
||||
SubstituteBindings::class,
|
||||
AuthenticateApplicationUser::class,
|
||||
]);
|
||||
|
||||
$middleware->group('client-api', [
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
\App\Http\Middleware\Api\Client\RequireClientApiKey::class,
|
||||
SubstituteBindings::class,
|
||||
RequireClientApiKey::class,
|
||||
]);
|
||||
|
||||
$middleware->group('daemon', [
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
\App\Http\Middleware\Api\Daemon\DaemonAuthenticate::class,
|
||||
SubstituteBindings::class,
|
||||
DaemonAuthenticate::class,
|
||||
]);
|
||||
|
||||
$middleware->replaceInGroup('web', \Illuminate\Foundation\Http\Middleware\ValidateCsrfToken::class, \App\Http\Middleware\VerifyCsrfToken::class);
|
||||
$middleware->replaceInGroup('web', ValidateCsrfToken::class, VerifyCsrfToken::class);
|
||||
|
||||
$middleware->alias([
|
||||
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
||||
'node.maintenance' => \App\Http\Middleware\MaintenanceMiddleware::class,
|
||||
'bindings' => SubstituteBindings::class,
|
||||
'guest' => RedirectIfAuthenticated::class,
|
||||
'node.maintenance' => MaintenanceMiddleware::class,
|
||||
]);
|
||||
|
||||
$middleware->priority([
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
SubstituteBindings::class,
|
||||
]);
|
||||
})
|
||||
->withSingletons([
|
||||
\Illuminate\Contracts\Console\Kernel::class => \App\Console\Kernel::class,
|
||||
\Illuminate\Contracts\Debug\ExceptionHandler::class => \App\Exceptions\Handler::class,
|
||||
Illuminate\Contracts\Console\Kernel::class => Kernel::class,
|
||||
ExceptionHandler::class => Handler::class,
|
||||
])
|
||||
->withExceptions(function (Exceptions $exceptions) {})
|
||||
->create();
|
||||
|
||||
@@ -1,19 +1,35 @@
|
||||
<?php
|
||||
|
||||
use App\Providers\ActivityLogServiceProvider;
|
||||
use App\Providers\AppServiceProvider;
|
||||
use App\Providers\BackupsServiceProvider;
|
||||
use App\Providers\EventServiceProvider;
|
||||
use App\Providers\Extensions\AvatarServiceProvider;
|
||||
use App\Providers\Extensions\CaptchaServiceProvider;
|
||||
use App\Providers\Extensions\FeatureServiceProvider;
|
||||
use App\Providers\Extensions\OAuthServiceProvider;
|
||||
use App\Providers\Extensions\TaskServiceProvider;
|
||||
use App\Providers\Filament\AdminPanelProvider;
|
||||
use App\Providers\Filament\AppPanelProvider;
|
||||
use App\Providers\Filament\FilamentServiceProvider;
|
||||
use App\Providers\Filament\ServerPanelProvider;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use SocialiteProviders\Manager\ServiceProvider;
|
||||
|
||||
return [
|
||||
App\Providers\ActivityLogServiceProvider::class,
|
||||
App\Providers\AppServiceProvider::class,
|
||||
App\Providers\BackupsServiceProvider::class,
|
||||
App\Providers\EventServiceProvider::class,
|
||||
App\Providers\Extensions\AvatarServiceProvider::class,
|
||||
App\Providers\Extensions\CaptchaServiceProvider::class,
|
||||
App\Providers\Extensions\FeatureServiceProvider::class,
|
||||
App\Providers\Extensions\OAuthServiceProvider::class,
|
||||
App\Providers\Extensions\TaskServiceProvider::class,
|
||||
App\Providers\Filament\FilamentServiceProvider::class,
|
||||
App\Providers\Filament\AdminPanelProvider::class,
|
||||
App\Providers\Filament\AppPanelProvider::class,
|
||||
App\Providers\Filament\ServerPanelProvider::class,
|
||||
App\Providers\RouteServiceProvider::class,
|
||||
SocialiteProviders\Manager\ServiceProvider::class,
|
||||
ActivityLogServiceProvider::class,
|
||||
AppServiceProvider::class,
|
||||
BackupsServiceProvider::class,
|
||||
EventServiceProvider::class,
|
||||
AvatarServiceProvider::class,
|
||||
CaptchaServiceProvider::class,
|
||||
FeatureServiceProvider::class,
|
||||
OAuthServiceProvider::class,
|
||||
TaskServiceProvider::class,
|
||||
FilamentServiceProvider::class,
|
||||
AdminPanelProvider::class,
|
||||
AppPanelProvider::class,
|
||||
ServerPanelProvider::class,
|
||||
RouteServiceProvider::class,
|
||||
ServiceProvider::class,
|
||||
];
|
||||
|
||||
@@ -9,51 +9,51 @@
|
||||
"ext-mbstring": "*",
|
||||
"ext-pdo": "*",
|
||||
"ext-zip": "*",
|
||||
"aws/aws-sdk-php": "^3.370",
|
||||
"aws/aws-sdk-php": "^3.373",
|
||||
"calebporzio/sushi": "^2.5",
|
||||
"dedoc/scramble": "^0.13",
|
||||
"filament/filament": "^4.5",
|
||||
"filament/filament": "^4.8",
|
||||
"gboquizosanchez/filament-log-viewer": "^2.2",
|
||||
"guzzlehttp/guzzle": "^7.10",
|
||||
"laravel/framework": "^12.53",
|
||||
"laravel/framework": "^12.54",
|
||||
"laravel/helpers": "^1.8",
|
||||
"laravel/sanctum": "^4.3",
|
||||
"laravel/socialite": "^5.24",
|
||||
"laravel/tinker": "^2.10.1",
|
||||
"laravel/socialite": "^5.25",
|
||||
"laravel/tinker": "^2.11",
|
||||
"laravel/ui": "^4.6",
|
||||
"lcobucci/jwt": "^5.6",
|
||||
"league/flysystem-aws-s3-v3": "^3.31",
|
||||
"league/flysystem-aws-s3-v3": "^3.32",
|
||||
"league/flysystem-memory": "^3.31",
|
||||
"phiki/phiki": "^2.0",
|
||||
"phpseclib/phpseclib": "~3.0.18",
|
||||
"predis/predis": "^2.3",
|
||||
"s1lentium/iptools": "~1.2.0",
|
||||
"secondnetwork/blade-tabler-icons": "^3.26",
|
||||
"socialiteproviders/authentik": "^5.2",
|
||||
"phiki/phiki": "^2.1",
|
||||
"phpseclib/phpseclib": "^3.0.49",
|
||||
"predis/predis": "^2.4",
|
||||
"s1lentium/iptools": "^1.2",
|
||||
"secondnetwork/blade-tabler-icons": "^3.40",
|
||||
"socialiteproviders/authentik": "^5.3",
|
||||
"socialiteproviders/discord": "^4.2",
|
||||
"socialiteproviders/steam": "^4.3",
|
||||
"spatie/laravel-data": "^4.19",
|
||||
"spatie/laravel-data": "^4.20",
|
||||
"spatie/laravel-fractal": "^6.4",
|
||||
"spatie/laravel-health": "^1.38",
|
||||
"spatie/laravel-health": "^1.39",
|
||||
"spatie/laravel-permission": "^6.24",
|
||||
"spatie/laravel-query-builder": "^6.4",
|
||||
"spatie/temporary-directory": "^2.3",
|
||||
"symfony/http-client": "^7.2",
|
||||
"symfony/mailgun-mailer": "^7.2",
|
||||
"symfony/postmark-mailer": "^7.2",
|
||||
"symfony/yaml": "^7.2",
|
||||
"webmozart/assert": "~1.11.0"
|
||||
"symfony/http-client": "^7.4",
|
||||
"symfony/mailgun-mailer": "^7.4",
|
||||
"symfony/postmark-mailer": "^7.4",
|
||||
"symfony/yaml": "^7.4",
|
||||
"webmozart/assert": "^1.12"
|
||||
},
|
||||
"require-dev": {
|
||||
"barryvdh/laravel-ide-helper": "^3.6",
|
||||
"fakerphp/faker": "^1.23.1",
|
||||
"larastan/larastan": "^3.4",
|
||||
"laravel/pail": "^1.2.2",
|
||||
"laravel/pint": "^1.15.3",
|
||||
"laravel/sail": "^1.41",
|
||||
"mockery/mockery": "^1.6.11",
|
||||
"nunomaduro/collision": "^8.6",
|
||||
"pestphp/pest": "^3.7",
|
||||
"fakerphp/faker": "^1.24",
|
||||
"larastan/larastan": "^3.9",
|
||||
"laravel/pail": "^1.2.6",
|
||||
"laravel/pint": "^1.28",
|
||||
"laravel/sail": "^1.53",
|
||||
"mockery/mockery": "^1.6.12",
|
||||
"nunomaduro/collision": "^8.9",
|
||||
"pestphp/pest": "^3.8",
|
||||
"pestphp/pest-plugin-faker": "^3.0",
|
||||
"pestphp/pest-plugin-livewire": "^3.0"
|
||||
},
|
||||
@@ -97,4 +97,4 @@
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true
|
||||
}
|
||||
}
|
||||
733
composer.lock
generated
733
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use Pdo\Mysql;
|
||||
|
||||
$database = env('DB_DATABASE', 'database.sqlite');
|
||||
$databasePath = database_path($database);
|
||||
@@ -65,7 +66,7 @@ return [
|
||||
'strict' => env('DB_STRICT_MODE', false),
|
||||
'engine' => null,
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
(PHP_VERSION_ID >= 80500 ? \Pdo\Mysql::ATTR_SSL_CA : \PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'),
|
||||
(PHP_VERSION_ID >= 80500 ? Mysql::ATTR_SSL_CA : PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'),
|
||||
]) : [],
|
||||
],
|
||||
|
||||
@@ -85,7 +86,7 @@ return [
|
||||
'strict' => env('DB_STRICT_MODE', false),
|
||||
'engine' => null,
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
(PHP_VERSION_ID >= 80500 ? \Pdo\Mysql::ATTR_SSL_CA : \PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'),
|
||||
(PHP_VERSION_ID >= 80500 ? Mysql::ATTR_SSL_CA : PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'),
|
||||
]) : [],
|
||||
],
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use League\Fractal\Serializer\JsonApiSerializer;
|
||||
|
||||
return [
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -12,7 +14,7 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'default_serializer' => League\Fractal\Serializer\JsonApiSerializer::class,
|
||||
'default_serializer' => JsonApiSerializer::class,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
<?php
|
||||
|
||||
use Spatie\Health\Notifications\CheckFailedNotification;
|
||||
use Spatie\Health\Notifications\Notifiable;
|
||||
use Spatie\Health\ResultStores\CacheHealthResultStore;
|
||||
|
||||
return [
|
||||
/*
|
||||
* A result store is responsible for saving the results of the checks. The
|
||||
@@ -15,7 +19,7 @@ return [
|
||||
],
|
||||
*/
|
||||
|
||||
Spatie\Health\ResultStores\CacheHealthResultStore::class => [
|
||||
CacheHealthResultStore::class => [
|
||||
'store' => 'file',
|
||||
],
|
||||
|
||||
@@ -40,14 +44,14 @@ return [
|
||||
'enabled' => false,
|
||||
|
||||
'notifications' => [
|
||||
Spatie\Health\Notifications\CheckFailedNotification::class => ['mail'],
|
||||
CheckFailedNotification::class => ['mail'],
|
||||
],
|
||||
|
||||
/*
|
||||
* Here you can specify the notifiable to which the notifications should be sent. The default
|
||||
* notifiable will use the variables specified in this config file.
|
||||
*/
|
||||
'notifiable' => Spatie\Health\Notifications\Notifiable::class,
|
||||
'notifiable' => Notifiable::class,
|
||||
|
||||
/*
|
||||
* When checks start failing, you could potentially end up getting
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Role;
|
||||
use Spatie\Permission\Models\Permission;
|
||||
|
||||
return [
|
||||
|
||||
'models' => [
|
||||
|
||||
'permission' => Spatie\Permission\Models\Permission::class,
|
||||
'permission' => Permission::class,
|
||||
|
||||
'role' => \App\Models\Role::class,
|
||||
'role' => Role::class,
|
||||
|
||||
],
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Cookie\Middleware\EncryptCookies;
|
||||
use Illuminate\Foundation\Http\Middleware\ValidateCsrfToken;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
|
||||
return [
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -15,7 +19,7 @@ return [
|
||||
'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
|
||||
'%s%s',
|
||||
'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
|
||||
Laravel\Sanctum\Sanctum::currentApplicationUrlWithPort()
|
||||
Sanctum::currentApplicationUrlWithPort()
|
||||
))),
|
||||
|
||||
/*
|
||||
@@ -57,7 +61,7 @@ return [
|
||||
*/
|
||||
|
||||
'middleware' => [
|
||||
'validate_csrf_token' => Illuminate\Foundation\Http\Middleware\ValidateCsrfToken::class,
|
||||
'encrypt_cookies' => Illuminate\Cookie\Middleware\EncryptCookies::class,
|
||||
'validate_csrf_token' => ValidateCsrfToken::class,
|
||||
'encrypt_cookies' => EncryptCookies::class,
|
||||
],
|
||||
];
|
||||
|
||||
@@ -10,8 +10,8 @@ return new class extends Migration
|
||||
* Run the migrations.
|
||||
*
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws \Throwable
|
||||
* @throws Exception
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
@@ -29,8 +29,8 @@ return new class extends Migration
|
||||
* Reverse the migrations.
|
||||
*
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws \Throwable
|
||||
* @throws Exception
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
|
||||
@@ -10,8 +10,8 @@ return new class extends Migration
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws \Throwable
|
||||
* @throws Exception
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ return new class extends Migration
|
||||
* Run the migrations.
|
||||
*
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
@@ -19,7 +20,7 @@ return new class extends Migration
|
||||
DB::table('failed_jobs')->whereNull('uuid')->cursor()->each(function ($job) {
|
||||
DB::table('failed_jobs')
|
||||
->where('id', $job->id)
|
||||
->update(['uuid' => (string) Illuminate\Support\Str::uuid()]);
|
||||
->update(['uuid' => (string) Str::uuid()]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Models\WebhookConfiguration;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
@@ -13,7 +14,7 @@ return new class extends Migration
|
||||
{
|
||||
Schema::create('webhooks', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignIdFor(\App\Models\WebhookConfiguration::class)->constrained();
|
||||
$table->foreignIdFor(WebhookConfiguration::class)->constrained();
|
||||
$table->string('event');
|
||||
$table->string('endpoint');
|
||||
$table->timestamp('successful_at')->nullable();
|
||||
|
||||
@@ -18,10 +18,10 @@ return new class extends Migration
|
||||
$pivotPermission = $columnNames['permission_pivot_key'] ?? 'permission_id';
|
||||
|
||||
if (empty($tableNames)) {
|
||||
throw new \Exception('Error: config/permission.php not loaded. Run [php artisan config:clear] and try again.');
|
||||
throw new Exception('Error: config/permission.php not loaded. Run [php artisan config:clear] and try again.');
|
||||
}
|
||||
if ($teams && empty($columnNames['team_foreign_key'] ?? null)) {
|
||||
throw new \Exception('Error: team_foreign_key on config/permission.php not loaded. Run [php artisan config:clear] and try again.');
|
||||
throw new Exception('Error: team_foreign_key on config/permission.php not loaded. Run [php artisan config:clear] and try again.');
|
||||
}
|
||||
|
||||
Schema::create($tableNames['permissions'], function (Blueprint $table) {
|
||||
@@ -128,7 +128,7 @@ return new class extends Migration
|
||||
$tableNames = config('permission.table_names');
|
||||
|
||||
if (empty($tableNames)) {
|
||||
throw new \Exception('Error: config/permission.php not found and defaults could not be merged. Please publish the package configuration before proceeding, or drop the tables manually.');
|
||||
throw new Exception('Error: config/permission.php not found and defaults could not be merged. Please publish the package configuration before proceeding, or drop the tables manually.');
|
||||
}
|
||||
|
||||
Schema::drop($tableNames['role_has_permissions']);
|
||||
|
||||
@@ -11,6 +11,8 @@ parameters:
|
||||
|
||||
level: 6
|
||||
|
||||
treatPhpDocTypesAsCertain: false
|
||||
|
||||
ignoreErrors:
|
||||
- identifier: argument.templateType
|
||||
- identifier: missingType.generics
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
function I({activeTab:w,isScrollable:f,isTabPersistedInQueryString:m,livewireId:g,tab:T,tabQueryStringKey:c}){return{boundResizeHandler:null,isScrollable:f,resizeDebounceTimer:null,tab:T,unsubscribeLivewireHook:null,withinDropdownIndex:null,withinDropdownMounted:!1,init(){let t=this.getTabs(),e=new URLSearchParams(window.location.search);m&&e.has(c)&&t.includes(e.get(c))&&(this.tab=e.get(c)),this.$watch("tab",()=>this.updateQueryString()),(!this.tab||!t.includes(this.tab))&&(this.tab=t[w-1]),this.unsubscribeLivewireHook=Livewire.hook("commit",({component:n,commit:d,succeed:r,fail:h,respond:u})=>{r(({snapshot:b,effect:i})=>{this.$nextTick(()=>{if(n.id!==g)return;let a=this.getTabs();a.includes(this.tab)||(this.tab=a[w-1]??this.tab)})})}),f||(this.boundResizeHandler=this.debouncedUpdateTabsWithinDropdown.bind(this),window.addEventListener("resize",this.boundResizeHandler),this.updateTabsWithinDropdown())},calculateAvailableWidth(t){let e=window.getComputedStyle(t);return Math.floor(t.clientWidth)-Math.ceil(parseFloat(e.paddingLeft))*2},calculateContainerGap(t){let e=window.getComputedStyle(t);return Math.ceil(parseFloat(e.columnGap))},calculateDropdownIconWidth(t){let e=t.querySelector(".fi-icon");return Math.ceil(e.clientWidth)},calculateTabItemGap(t){let e=window.getComputedStyle(t);return Math.ceil(parseFloat(e.columnGap)||8)},calculateTabItemPadding(t){let e=window.getComputedStyle(t);return Math.ceil(parseFloat(e.paddingLeft))+Math.ceil(parseFloat(e.paddingRight))},findOverflowIndex(t,e,n,d,r,h){let u=t.map(i=>Math.ceil(i.clientWidth)),b=t.map(i=>{let a=i.querySelector(".fi-tabs-item-label"),s=i.querySelector(".fi-badge"),o=Math.ceil(a.clientWidth),l=s?Math.ceil(s.clientWidth):0;return{label:o,badge:l,total:o+(l>0?d+l:0)}});for(let i=0;i<t.length;i++){let a=u.slice(0,i+1).reduce((p,y)=>p+y,0),s=i*n,o=b.slice(i+1),l=o.length>0,W=l?Math.max(...o.map(p=>p.total)):0,D=l?r+W+d+h+n:0;if(a+s+D>e)return i}return-1},get isDropdownButtonVisible(){return this.withinDropdownMounted?this.withinDropdownIndex===null?!1:this.getTabs().findIndex(e=>e===this.tab)<this.withinDropdownIndex:!0},getTabs(){return this.$refs.tabsData?JSON.parse(this.$refs.tabsData.value):[]},updateQueryString(){if(!m)return;let t=new URL(window.location.href);t.searchParams.set(c,this.tab),history.replaceState(null,document.title,t.toString())},debouncedUpdateTabsWithinDropdown(){clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=setTimeout(()=>this.updateTabsWithinDropdown(),150)},async updateTabsWithinDropdown(){this.withinDropdownIndex=null,this.withinDropdownMounted=!1,await this.$nextTick();let t=this.$el.querySelector(".fi-tabs"),e=t.querySelector(".fi-tabs-item:last-child"),n=Array.from(t.children).slice(0,-1),d=n.map(s=>s.style.display);n.forEach(s=>s.style.display=""),t.offsetHeight;let r=this.calculateAvailableWidth(t),h=this.calculateContainerGap(t),u=this.calculateDropdownIconWidth(e),b=this.calculateTabItemGap(n[0]),i=this.calculateTabItemPadding(n[0]),a=this.findOverflowIndex(n,r,h,b,i,u);n.forEach((s,o)=>s.style.display=d[o]),a!==-1&&(this.withinDropdownIndex=a),this.withinDropdownMounted=!0},destroy(){this.unsubscribeLivewireHook?.(),this.boundResizeHandler&&window.removeEventListener("resize",this.boundResizeHandler),clearTimeout(this.resizeDebounceTimer)}}}export{I as default};
|
||||
function v({activeTab:f,isScrollable:w,isTabPersistedInQueryString:m,livewireId:g,tab:T,tabQueryStringKey:r}){return{boundResizeHandler:null,isScrollable:w,resizeDebounceTimer:null,tab:T,unsubscribeLivewireHook:null,withinDropdownIndex:null,withinDropdownMounted:!1,init(){let t=this.getTabs(),e=new URLSearchParams(window.location.search);m&&e.has(r)&&t.includes(e.get(r))&&(this.tab=e.get(r)),(!this.tab||!t.includes(this.tab))&&(this.tab=t[f-1]),this.$watch("tab",()=>{this.updateQueryString(),this.autofocusFields()}),this.autofocusFields(!0),this.unsubscribeLivewireHook=Livewire.hook("commit",({component:i,commit:c,succeed:d,fail:h,respond:u})=>{d(({snapshot:b,effect:n})=>{this.$nextTick(()=>{if(i.id!==g)return;let o=this.getTabs();o.includes(this.tab)||(this.tab=o[f-1]??this.tab)})})}),w||(this.boundResizeHandler=this.debouncedUpdateTabsWithinDropdown.bind(this),window.addEventListener("resize",this.boundResizeHandler),this.updateTabsWithinDropdown())},calculateAvailableWidth(t){let e=window.getComputedStyle(t);return Math.floor(t.clientWidth)-Math.ceil(parseFloat(e.paddingLeft))*2},calculateContainerGap(t){let e=window.getComputedStyle(t);return Math.ceil(parseFloat(e.columnGap))},calculateDropdownIconWidth(t){let e=t.querySelector(".fi-icon");return Math.ceil(e.clientWidth)},calculateTabItemGap(t){let e=window.getComputedStyle(t);return Math.ceil(parseFloat(e.columnGap)||8)},calculateTabItemPadding(t){let e=window.getComputedStyle(t);return Math.ceil(parseFloat(e.paddingLeft))+Math.ceil(parseFloat(e.paddingRight))},findOverflowIndex(t,e,i,c,d,h){let u=t.map(n=>Math.ceil(n.clientWidth)),b=t.map(n=>{let o=n.querySelector(".fi-tabs-item-label"),s=n.querySelector(".fi-badge"),a=Math.ceil(o.clientWidth),l=s?Math.ceil(s.clientWidth):0;return{label:a,badge:l,total:a+(l>0?c+l:0)}});for(let n=0;n<t.length;n++){let o=u.slice(0,n+1).reduce((p,y)=>p+y,0),s=n*i,a=b.slice(n+1),l=a.length>0,D=l?Math.max(...a.map(p=>p.total)):0,W=l?d+D+c+h+i:0;if(o+s+W>e)return n}return-1},get isDropdownButtonVisible(){return this.withinDropdownMounted?this.withinDropdownIndex===null?!1:this.getTabs().findIndex(e=>e===this.tab)<this.withinDropdownIndex:!0},getTabs(){return this.$refs.tabsData?JSON.parse(this.$refs.tabsData.value):[]},updateQueryString(){if(!m)return;let t=new URL(window.location.href);t.searchParams.set(r,this.tab),history.replaceState(null,document.title,t.toString())},autofocusFields(t=!1){this.$nextTick(()=>{if(t&&document.activeElement&&document.activeElement!==document.body&&this.$el.compareDocumentPosition(document.activeElement)&Node.DOCUMENT_POSITION_PRECEDING)return;let e=this.$el.querySelectorAll(".fi-sc-tabs-tab.fi-active [autofocus]");for(let i of e)if(i.focus(),document.activeElement===i)break})},debouncedUpdateTabsWithinDropdown(){clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=setTimeout(()=>this.updateTabsWithinDropdown(),150)},async updateTabsWithinDropdown(){this.withinDropdownIndex=null,this.withinDropdownMounted=!1,await this.$nextTick();let t=this.$el.querySelector(".fi-tabs"),e=t.querySelector(".fi-tabs-item:last-child"),i=Array.from(t.children).slice(0,-1),c=i.map(s=>s.style.display);i.forEach(s=>s.style.display=""),t.offsetHeight;let d=this.calculateAvailableWidth(t),h=this.calculateContainerGap(t),u=this.calculateDropdownIconWidth(e),b=this.calculateTabItemGap(i[0]),n=this.calculateTabItemPadding(i[0]),o=this.findOverflowIndex(i,d,h,b,n,u);i.forEach((s,a)=>s.style.display=c[a]),o!==-1&&(this.withinDropdownIndex=o),this.withinDropdownMounted=!0},destroy(){this.unsubscribeLivewireHook?.(),this.boundResizeHandler&&window.removeEventListener("resize",this.boundResizeHandler),clearTimeout(this.resizeDebounceTimer)}}}export{v as default};
|
||||
|
||||
@@ -1 +1 @@
|
||||
function o({isSkippable:s,isStepPersistedInQueryString:i,key:r,startStep:h,stepQueryStringKey:n}){return{step:null,init(){this.$watch("step",()=>this.updateQueryString()),this.step=this.getSteps().at(h-1),this.autofocusFields()},async requestNextStep(){await this.$wire.callSchemaComponentMethod(r,"nextStep",{currentStepIndex:this.getStepIndex(this.step)})},goToNextStep(){let t=this.getStepIndex(this.step)+1;t>=this.getSteps().length||(this.step=this.getSteps()[t],this.autofocusFields(),this.scroll())},goToPreviousStep(){let t=this.getStepIndex(this.step)-1;t<0||(this.step=this.getSteps()[t],this.autofocusFields(),this.scroll())},goToStep(t){let e=this.getStepIndex(t);e<=-1||!s&&e>this.getStepIndex(this.step)||(this.step=t,this.autofocusFields(),this.scroll())},scroll(){this.$nextTick(()=>{this.$refs.header?.children[this.getStepIndex(this.step)].scrollIntoView({behavior:"smooth",block:"start"})})},autofocusFields(){this.$nextTick(()=>this.$refs[`step-${this.step}`].querySelector("[autofocus]")?.focus())},getStepIndex(t){let e=this.getSteps().findIndex(p=>p===t);return e===-1?0:e},getSteps(){return JSON.parse(this.$refs.stepsData.value)},isFirstStep(){return this.getStepIndex(this.step)<=0},isLastStep(){return this.getStepIndex(this.step)+1>=this.getSteps().length},isStepAccessible(t){return s||this.getStepIndex(this.step)>this.getStepIndex(t)},updateQueryString(){if(!i)return;let t=new URL(window.location.href);t.searchParams.set(n,this.step),history.replaceState(null,document.title,t.toString())}}}export{o as default};
|
||||
function p({isSkippable:i,isStepPersistedInQueryString:n,key:r,startStep:o,stepQueryStringKey:h}){return{step:null,init(){this.step=this.getSteps().at(o-1),this.$watch("step",()=>{this.updateQueryString(),this.autofocusFields()}),this.autofocusFields(!0)},async requestNextStep(){await this.$wire.callSchemaComponentMethod(r,"nextStep",{currentStepIndex:this.getStepIndex(this.step)})},goToNextStep(){let t=this.getStepIndex(this.step)+1;t>=this.getSteps().length||(this.step=this.getSteps()[t],this.scroll())},goToPreviousStep(){let t=this.getStepIndex(this.step)-1;t<0||(this.step=this.getSteps()[t],this.scroll())},goToStep(t){let e=this.getStepIndex(t);e<=-1||!i&&e>this.getStepIndex(this.step)||(this.step=t,this.scroll())},scroll(){this.$nextTick(()=>{this.$refs.header?.children[this.getStepIndex(this.step)].scrollIntoView({behavior:"smooth",block:"start"})})},autofocusFields(t=!1){this.$nextTick(()=>{if(t&&document.activeElement&&document.activeElement!==document.body&&this.$el.compareDocumentPosition(document.activeElement)&Node.DOCUMENT_POSITION_PRECEDING)return;let e=this.$refs[`step-${this.step}`]?.querySelectorAll("[autofocus]")??[];for(let s of e)if(s.focus(),document.activeElement===s)break})},getStepIndex(t){let e=this.getSteps().findIndex(s=>s===t);return e===-1?0:e},getSteps(){return JSON.parse(this.$refs.stepsData.value)},isFirstStep(){return this.getStepIndex(this.step)<=0},isLastStep(){return this.getStepIndex(this.step)+1>=this.getSteps().length},isStepAccessible(t){return i||this.getStepIndex(this.step)>this.getStepIndex(t)},updateQueryString(){if(!n)return;let t=new URL(window.location.href);t.searchParams.set(h,this.step),history.replaceState(null,document.title,t.toString())}}}export{p as default};
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -11,7 +11,7 @@ use PHPUnit\Framework\Assert;
|
||||
trait AssertsActivityLogged
|
||||
{
|
||||
/**
|
||||
* @param \Illuminate\Database\Eloquent\Model|array $subjects
|
||||
* @param Model|array $subjects
|
||||
*/
|
||||
public function assertActivityFor(string $event, ?Model $actor, ...$subjects): void
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
use App\Enums\ServerState;
|
||||
use App\Enums\SubuserPermission;
|
||||
use App\Http\Controllers\Api\Client\Servers\SettingsController;
|
||||
use App\Models\ActivityLog;
|
||||
use App\Repositories\Daemon\DaemonServerRepository;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
@@ -37,7 +38,7 @@ it('server description can be changed', function () {
|
||||
->assertStatus(Response::HTTP_NO_CONTENT);
|
||||
|
||||
$server = $server->refresh();
|
||||
$logged = \App\Models\ActivityLog::first();
|
||||
$logged = ActivityLog::first();
|
||||
expect()->toLogActivities(1)
|
||||
->and($logged->properties['old'])->toBe($originalDescription)
|
||||
->and($logged->properties['new'])->toBe($newDescription)
|
||||
@@ -127,7 +128,7 @@ test('can change docker image in use by server', function () {
|
||||
|
||||
$server = $server->refresh();
|
||||
|
||||
$logItem = \App\Models\ActivityLog::first();
|
||||
$logItem = ActivityLog::first();
|
||||
expect()->toLogActivities(1)
|
||||
->and($logItem->properties['old'])->toBe($oldImage)
|
||||
->and($logItem->properties['new'])->toBe($newImage)
|
||||
@@ -158,11 +159,11 @@ test('can be reinstalled', function () {
|
||||
[$user, $server] = generateTestAccount([SubuserPermission::SettingsReinstall]);
|
||||
expect($server->isInstalled())->toBeTrue();
|
||||
|
||||
$service = \Mockery::mock(DaemonServerRepository::class);
|
||||
$service = Mockery::mock(DaemonServerRepository::class);
|
||||
$this->app->instance(DaemonServerRepository::class, $service);
|
||||
|
||||
$service->expects('setServer')
|
||||
->with(\Mockery::on(function ($value) use ($server) {
|
||||
->with(Mockery::on(function ($value) use ($server) {
|
||||
return $value->uuid === $server->uuid;
|
||||
}))
|
||||
->andReturnSelf()
|
||||
|
||||
@@ -14,7 +14,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_account_details_are_returned(): void
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get('/api/client/account');
|
||||
@@ -41,7 +41,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_email_is_updated(): void
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->putJson('/api/client/account/email', [
|
||||
@@ -60,7 +60,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_email_is_not_updated_when_password_is_invalid(): void
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->putJson('/api/client/account/email', [
|
||||
@@ -79,7 +79,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_email_is_not_updated_when_not_valid(): void
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->putJson('/api/client/account/email', [
|
||||
@@ -106,7 +106,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_password_is_updated(): void
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
|
||||
$initialHash = $user->password;
|
||||
@@ -132,7 +132,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_password_is_not_updated_if_current_password_is_invalid(): void
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->putJson('/api/client/account/password', [
|
||||
@@ -175,7 +175,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_error_is_returned_if_password_is_not_confirmed(): void
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->putJson('/api/client/account/password', [
|
||||
|
||||
@@ -26,9 +26,9 @@ class ApiKeyControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_api_keys_are_returned(): void
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
/** @var \App\Models\ApiKey $key */
|
||||
/** @var ApiKey $key */
|
||||
$key = ApiKey::factory()->for($user)->create([
|
||||
'key_type' => ApiKey::TYPE_ACCOUNT,
|
||||
]);
|
||||
@@ -49,7 +49,7 @@ class ApiKeyControllerTest extends ClientApiIntegrationTestCase
|
||||
#[DataProvider('validIPAddressDataProvider')]
|
||||
public function test_api_key_can_be_created_for_account(array $data): void
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
|
||||
// Small subtest to ensure we're always comparing the number of keys to the
|
||||
@@ -67,7 +67,7 @@ class ApiKeyControllerTest extends ClientApiIntegrationTestCase
|
||||
->assertOk()
|
||||
->assertJsonPath('object', ApiKey::RESOURCE_NAME);
|
||||
|
||||
/** @var \App\Models\ApiKey $key */
|
||||
/** @var ApiKey $key */
|
||||
$key = ApiKey::query()->where('identifier', $response->json('attributes.identifier'))->firstOrFail();
|
||||
|
||||
$this->assertJsonTransformedWith($response->json('attributes'), $key);
|
||||
@@ -101,7 +101,7 @@ class ApiKeyControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_api_key_limit_is_applied(): void
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
ApiKey::factory()->times(config('panel.api.key_limit', 25))->for($user)->create([
|
||||
'key_type' => ApiKey::TYPE_ACCOUNT,
|
||||
@@ -155,9 +155,9 @@ class ApiKeyControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_api_key_can_be_deleted(): void
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
/** @var \App\Models\ApiKey $key */
|
||||
/** @var ApiKey $key */
|
||||
$key = ApiKey::factory()->for($user)->create([
|
||||
'key_type' => ApiKey::TYPE_ACCOUNT,
|
||||
]);
|
||||
@@ -174,9 +174,9 @@ class ApiKeyControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_non_existent_api_key_deletion_returns404_error(): void
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
/** @var \App\Models\ApiKey $key */
|
||||
/** @var ApiKey $key */
|
||||
$key = ApiKey::factory()->create([
|
||||
'user_id' => $user->id,
|
||||
'key_type' => ApiKey::TYPE_ACCOUNT,
|
||||
@@ -195,11 +195,11 @@ class ApiKeyControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_api_key_belonging_to_another_user_cannot_be_deleted(): void
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
/** @var \App\Models\User $user2 */
|
||||
/** @var User $user2 */
|
||||
$user2 = User::factory()->create();
|
||||
/** @var \App\Models\ApiKey $key */
|
||||
/** @var ApiKey $key */
|
||||
$key = ApiKey::factory()->for($user2)->create([
|
||||
'key_type' => ApiKey::TYPE_ACCOUNT,
|
||||
]);
|
||||
@@ -218,9 +218,9 @@ class ApiKeyControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_application_api_key_cannot_be_deleted(): void
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
/** @var \App\Models\ApiKey $key */
|
||||
/** @var ApiKey $key */
|
||||
$key = ApiKey::factory()->for($user)->create([
|
||||
'key_type' => ApiKey::TYPE_APPLICATION,
|
||||
]);
|
||||
|
||||
@@ -20,10 +20,10 @@ class ClientControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_only_logged_in_users_servers_are_returned(): void
|
||||
{
|
||||
/** @var \App\Models\User[] $users */
|
||||
/** @var User[] $users */
|
||||
$users = User::factory()->times(3)->create();
|
||||
|
||||
/** @var \App\Models\Server[] $servers */
|
||||
/** @var Server[] $servers */
|
||||
$servers = [
|
||||
$this->createServerModel(['user_id' => $users[0]->id]),
|
||||
$this->createServerModel(['user_id' => $users[1]->id]),
|
||||
@@ -47,11 +47,11 @@ class ClientControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_servers_are_filtered_using_name_and_uuid_information(): void
|
||||
{
|
||||
/** @var \App\Models\User[] $users */
|
||||
/** @var User[] $users */
|
||||
$users = User::factory()->times(2)->create();
|
||||
$users[0]->syncRoles(Role::getRootAdmin());
|
||||
|
||||
/** @var \App\Models\Server[] $servers */
|
||||
/** @var Server[] $servers */
|
||||
$servers = [
|
||||
$this->createServerModel(['user_id' => $users[0]->id, 'name' => 'julia']),
|
||||
$this->createServerModel(['user_id' => $users[1]->id, 'uuid_short' => '12121212', 'name' => 'janice']),
|
||||
@@ -103,8 +103,8 @@ class ClientControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_servers_are_filtered_using_allocation_information(): void
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var \App\Models\Server $server */
|
||||
/** @var User $user */
|
||||
/** @var Server $server */
|
||||
[$user, $server] = $this->generateTestAccount();
|
||||
$server2 = $this->createServerModel(['user_id' => $user->id, 'node_id' => $server->node_id]);
|
||||
|
||||
@@ -145,7 +145,7 @@ class ClientControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_servers_user_is_a_subuser_of_are_returned(): void
|
||||
{
|
||||
/** @var \App\Models\User[] $users */
|
||||
/** @var User[] $users */
|
||||
$users = User::factory()->times(3)->create();
|
||||
$servers = [
|
||||
$this->createServerModel(['user_id' => $users[0]->id]),
|
||||
@@ -176,7 +176,7 @@ class ClientControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_filter_only_owner_servers(): void
|
||||
{
|
||||
/** @var \App\Models\User[] $users */
|
||||
/** @var User[] $users */
|
||||
$users = User::factory()->times(3)->create();
|
||||
$servers = [
|
||||
$this->createServerModel(['user_id' => $users[0]->id]),
|
||||
@@ -205,7 +205,7 @@ class ClientControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_permissions_are_returned(): void
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
|
||||
$this->actingAs($user)
|
||||
@@ -225,7 +225,7 @@ class ClientControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_only_admin_level_servers_are_returned(): void
|
||||
{
|
||||
/** @var \App\Models\User[] $users */
|
||||
/** @var User[] $users */
|
||||
$users = User::factory()->times(4)->create();
|
||||
$users[0]->syncRoles(Role::getRootAdmin());
|
||||
|
||||
@@ -260,7 +260,7 @@ class ClientControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_all_servers_are_returned_to_admin(): void
|
||||
{
|
||||
/** @var \App\Models\User[] $users */
|
||||
/** @var User[] $users */
|
||||
$users = User::factory()->times(4)->create();
|
||||
$users[0]->syncRoles(Role::getRootAdmin());
|
||||
|
||||
@@ -291,7 +291,7 @@ class ClientControllerTest extends ClientApiIntegrationTestCase
|
||||
#[DataProvider('filterTypeDataProvider')]
|
||||
public function test_no_servers_are_returned_if_admin_filter_is_passed_by_regular_user(string $type): void
|
||||
{
|
||||
/** @var \App\Models\User[] $users */
|
||||
/** @var User[] $users */
|
||||
$users = User::factory()->times(3)->create();
|
||||
|
||||
$this->createServerModel(['user_id' => $users[0]->id]);
|
||||
@@ -310,7 +310,7 @@ class ClientControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_only_primary_allocation_is_returned_to_subuser(): void
|
||||
{
|
||||
/** @var \App\Models\Server $server */
|
||||
/** @var Server $server */
|
||||
[$user, $server] = $this->generateTestAccount([SubuserPermission::WebsocketConnect]);
|
||||
$server->allocation->notes = 'Test notes';
|
||||
$server->allocation->save();
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Tests\Integration\Api\Client\Server\Allocation;
|
||||
|
||||
use App\Enums\SubuserPermission;
|
||||
use App\Models\Allocation;
|
||||
use App\Models\Server;
|
||||
use App\Tests\Integration\Api\Client\ClientApiIntegrationTestCase;
|
||||
use Illuminate\Http\Response;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
@@ -28,7 +29,7 @@ class CreateNewAllocationTest extends ClientApiIntegrationTestCase
|
||||
#[DataProvider('permissionDataProvider')]
|
||||
public function test_new_allocation_can_be_assigned_to_server(array $permission): void
|
||||
{
|
||||
/** @var \App\Models\Server $server */
|
||||
/** @var Server $server */
|
||||
[$user, $server] = $this->generateTestAccount($permission);
|
||||
$server->update(['allocation_limit' => 2]);
|
||||
|
||||
@@ -47,7 +48,7 @@ class CreateNewAllocationTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_allocation_cannot_be_created_if_user_does_not_have_permission(): void
|
||||
{
|
||||
/** @var \App\Models\Server $server */
|
||||
/** @var Server $server */
|
||||
[$user, $server] = $this->generateTestAccount([SubuserPermission::AllocationUpdate]);
|
||||
$server->update(['allocation_limit' => 2]);
|
||||
|
||||
@@ -61,7 +62,7 @@ class CreateNewAllocationTest extends ClientApiIntegrationTestCase
|
||||
{
|
||||
config()->set('panel.client_features.allocations.enabled', false);
|
||||
|
||||
/** @var \App\Models\Server $server */
|
||||
/** @var Server $server */
|
||||
[$user, $server] = $this->generateTestAccount();
|
||||
$server->update(['allocation_limit' => 2]);
|
||||
|
||||
@@ -76,7 +77,7 @@ class CreateNewAllocationTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_allocation_cannot_be_created_if_server_is_at_limit(): void
|
||||
{
|
||||
/** @var \App\Models\Server $server */
|
||||
/** @var Server $server */
|
||||
[$user, $server] = $this->generateTestAccount();
|
||||
$server->update(['allocation_limit' => 1]);
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Tests\Integration\Api\Client\Server\Allocation;
|
||||
|
||||
use App\Enums\SubuserPermission;
|
||||
use App\Models\Allocation;
|
||||
use App\Models\Server;
|
||||
use App\Tests\Integration\Api\Client\ClientApiIntegrationTestCase;
|
||||
use Illuminate\Http\Response;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
@@ -17,11 +18,11 @@ class DeleteAllocationTest extends ClientApiIntegrationTestCase
|
||||
#[DataProvider('permissionDataProvider')]
|
||||
public function test_allocation_can_be_deleted_from_server(array $permission): void
|
||||
{
|
||||
/** @var \App\Models\Server $server */
|
||||
/** @var Server $server */
|
||||
[$user, $server] = $this->generateTestAccount($permission);
|
||||
$server->update(['allocation_limit' => 2]);
|
||||
|
||||
/** @var \App\Models\Allocation $allocation */
|
||||
/** @var Allocation $allocation */
|
||||
$allocation = Allocation::factory()->create([
|
||||
'server_id' => $server->id,
|
||||
'node_id' => $server->node_id,
|
||||
@@ -39,7 +40,7 @@ class DeleteAllocationTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_primary_allocation_can_be_deleted_from_server(): void
|
||||
{
|
||||
/** @var \App\Models\Server $server */
|
||||
/** @var Server $server */
|
||||
[$user, $server] = $this->generateTestAccount();
|
||||
$server->update(['allocation_limit' => 2]);
|
||||
|
||||
@@ -55,10 +56,10 @@ class DeleteAllocationTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_error_is_returned_if_user_does_not_have_permission(): void
|
||||
{
|
||||
/** @var \App\Models\Server $server */
|
||||
/** @var Server $server */
|
||||
[$user, $server] = $this->generateTestAccount([SubuserPermission::AllocationCreate]);
|
||||
|
||||
/** @var \App\Models\Allocation $allocation */
|
||||
/** @var Allocation $allocation */
|
||||
$allocation = Allocation::factory()->create([
|
||||
'server_id' => $server->id,
|
||||
'node_id' => $server->node_id,
|
||||
@@ -74,7 +75,7 @@ class DeleteAllocationTest extends ClientApiIntegrationTestCase
|
||||
{
|
||||
[$user, $server] = $this->generateTestAccount();
|
||||
|
||||
/** @var \App\Models\Allocation $allocation */
|
||||
/** @var Allocation $allocation */
|
||||
$allocation = Allocation::factory()->forServer($server)->create(['notes' => 'Test notes']);
|
||||
|
||||
$this->actingAs($user)->deleteJson($this->link($allocation))
|
||||
@@ -91,7 +92,7 @@ class DeleteAllocationTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_error_is_returned_if_allocation_does_not_belong_to_server(): void
|
||||
{
|
||||
/** @var \App\Models\Server $server */
|
||||
/** @var Server $server */
|
||||
[$user, $server] = $this->generateTestAccount();
|
||||
[, $server2] = $this->generateTestAccount();
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ class DeleteBackupTest extends ClientApiIntegrationTestCase
|
||||
|
||||
[$user, $server] = $this->generateTestAccount([SubuserPermission::BackupDelete]);
|
||||
|
||||
/** @var \App\Models\Backup $backup */
|
||||
/** @var Backup $backup */
|
||||
$backup = Backup::factory()->create(['server_id' => $server->id]);
|
||||
|
||||
$this->repository->expects('setServer->delete')->with(
|
||||
|
||||
@@ -32,7 +32,7 @@ class CreateServerScheduleTest extends ClientApiIntegrationTestCase
|
||||
|
||||
$this->assertNotNull($id = $response->json('attributes.id'));
|
||||
|
||||
/** @var \App\Models\Schedule $schedule */
|
||||
/** @var Schedule $schedule */
|
||||
$schedule = Schedule::query()->findOrFail($id);
|
||||
$this->assertFalse($schedule->is_active);
|
||||
$this->assertFalse($schedule->is_processing);
|
||||
|
||||
@@ -23,7 +23,7 @@ class ExecuteScheduleTest extends ClientApiIntegrationTestCase
|
||||
|
||||
Bus::fake();
|
||||
|
||||
/** @var \App\Models\Schedule $schedule */
|
||||
/** @var Schedule $schedule */
|
||||
$schedule = Schedule::factory()->create([
|
||||
'server_id' => $server->id,
|
||||
]);
|
||||
@@ -33,7 +33,7 @@ class ExecuteScheduleTest extends ClientApiIntegrationTestCase
|
||||
$response->assertJsonPath('errors.0.code', 'DisplayException');
|
||||
$response->assertJsonPath('errors.0.detail', 'Cannot process schedule for task execution: no tasks are registered.');
|
||||
|
||||
/** @var \App\Models\Task $task */
|
||||
/** @var Task $task */
|
||||
$task = Task::factory()->create([
|
||||
'schedule_id' => $schedule->id,
|
||||
'sequence_id' => 1,
|
||||
@@ -58,7 +58,7 @@ class ExecuteScheduleTest extends ClientApiIntegrationTestCase
|
||||
{
|
||||
[$user, $server] = $this->generateTestAccount([SubuserPermission::ScheduleCreate]);
|
||||
|
||||
/** @var \App\Models\Schedule $schedule */
|
||||
/** @var Schedule $schedule */
|
||||
$schedule = Schedule::factory()->create(['server_id' => $server->id]);
|
||||
|
||||
$this->actingAs($user)->postJson($this->link($schedule, '/execute'))->assertForbidden();
|
||||
|
||||
@@ -29,9 +29,9 @@ class GetServerSchedulesTest extends ClientApiIntegrationTestCase
|
||||
{
|
||||
[$user, $server] = $this->generateTestAccount($permissions);
|
||||
|
||||
/** @var \App\Models\Schedule $schedule */
|
||||
/** @var Schedule $schedule */
|
||||
$schedule = Schedule::factory()->create(['server_id' => $server->id]);
|
||||
/** @var \App\Models\Task $task */
|
||||
/** @var Task $task */
|
||||
$task = Task::factory()->create(['schedule_id' => $schedule->id, 'sequence_id' => 1, 'time_offset' => 0]);
|
||||
|
||||
$response = $this->actingAs($user)
|
||||
|
||||
@@ -31,7 +31,7 @@ class UpdateServerScheduleTest extends ClientApiIntegrationTestCase
|
||||
{
|
||||
[$user, $server] = $this->generateTestAccount($permissions);
|
||||
|
||||
/** @var \App\Models\Schedule $schedule */
|
||||
/** @var Schedule $schedule */
|
||||
$schedule = Schedule::factory()->create(['server_id' => $server->id]);
|
||||
$expected = Utilities::getScheduleNextRunDate('5', '*', '*', '*', '*');
|
||||
|
||||
@@ -87,7 +87,7 @@ class UpdateServerScheduleTest extends ClientApiIntegrationTestCase
|
||||
{
|
||||
[$user, $server] = $this->generateTestAccount();
|
||||
|
||||
/** @var \App\Models\Schedule $schedule */
|
||||
/** @var Schedule $schedule */
|
||||
$schedule = Schedule::factory()->create([
|
||||
'server_id' => $server->id,
|
||||
'is_active' => true,
|
||||
|
||||
@@ -19,7 +19,7 @@ class CreateServerScheduleTaskTest extends ClientApiIntegrationTestCase
|
||||
{
|
||||
[$user, $server] = $this->generateTestAccount($permissions);
|
||||
|
||||
/** @var \App\Models\Schedule $schedule */
|
||||
/** @var Schedule $schedule */
|
||||
$schedule = Schedule::factory()->create(['server_id' => $server->id]);
|
||||
$this->assertEmpty($schedule->tasks);
|
||||
|
||||
@@ -31,7 +31,7 @@ class CreateServerScheduleTaskTest extends ClientApiIntegrationTestCase
|
||||
]);
|
||||
|
||||
$response->assertOk();
|
||||
/** @var \App\Models\Task $task */
|
||||
/** @var Task $task */
|
||||
$task = Task::query()->findOrFail($response->json('attributes.id'));
|
||||
|
||||
$this->assertSame($schedule->id, $task->schedule_id);
|
||||
@@ -49,7 +49,7 @@ class CreateServerScheduleTaskTest extends ClientApiIntegrationTestCase
|
||||
{
|
||||
[$user, $server] = $this->generateTestAccount();
|
||||
|
||||
/** @var \App\Models\Schedule $schedule */
|
||||
/** @var Schedule $schedule */
|
||||
$schedule = Schedule::factory()->create(['server_id' => $server->id]);
|
||||
|
||||
$response = $this->actingAs($user)->postJson($this->link($schedule, '/tasks'))->assertStatus(Response::HTTP_UNPROCESSABLE_ENTITY);
|
||||
@@ -94,7 +94,7 @@ class CreateServerScheduleTaskTest extends ClientApiIntegrationTestCase
|
||||
{
|
||||
[$user, $server] = $this->generateTestAccount();
|
||||
|
||||
/** @var \App\Models\Schedule $schedule */
|
||||
/** @var Schedule $schedule */
|
||||
$schedule = Schedule::factory()->create(['server_id' => $server->id]);
|
||||
|
||||
$this->actingAs($user)->postJson($this->link($schedule, '/tasks'), [
|
||||
@@ -123,7 +123,7 @@ class CreateServerScheduleTaskTest extends ClientApiIntegrationTestCase
|
||||
|
||||
[$user, $server] = $this->generateTestAccount();
|
||||
|
||||
/** @var \App\Models\Schedule $schedule */
|
||||
/** @var Schedule $schedule */
|
||||
$schedule = Schedule::factory()->create(['server_id' => $server->id]);
|
||||
Task::factory()->times(2)->create(['schedule_id' => $schedule->id]);
|
||||
|
||||
@@ -146,7 +146,7 @@ class CreateServerScheduleTaskTest extends ClientApiIntegrationTestCase
|
||||
[$user, $server] = $this->generateTestAccount();
|
||||
$server2 = $this->createServerModel(['owner_id' => $user->id]);
|
||||
|
||||
/** @var \App\Models\Schedule $schedule */
|
||||
/** @var Schedule $schedule */
|
||||
$schedule = Schedule::factory()->create(['server_id' => $server2->id]);
|
||||
|
||||
$this->actingAs($user)
|
||||
@@ -162,7 +162,7 @@ class CreateServerScheduleTaskTest extends ClientApiIntegrationTestCase
|
||||
{
|
||||
[$user, $server] = $this->generateTestAccount([SubuserPermission::ScheduleCreate]);
|
||||
|
||||
/** @var \App\Models\Schedule $schedule */
|
||||
/** @var Schedule $schedule */
|
||||
$schedule = Schedule::factory()->create(['server_id' => $server->id]);
|
||||
|
||||
$this->actingAs($user)
|
||||
|
||||
@@ -18,7 +18,7 @@ class SettingsControllerTest extends ClientApiIntegrationTestCase
|
||||
#[DataProvider('renamePermissionsDataProvider')]
|
||||
public function test_server_name_can_be_changed(array $permissions): void
|
||||
{
|
||||
/** @var \App\Models\Server $server */
|
||||
/** @var Server $server */
|
||||
[$user, $server] = $this->generateTestAccount($permissions);
|
||||
$originalName = $server->name;
|
||||
|
||||
@@ -68,7 +68,7 @@ class SettingsControllerTest extends ClientApiIntegrationTestCase
|
||||
#[DataProvider('reinstallPermissionsDataProvider')]
|
||||
public function test_server_can_be_reinstalled(array $permissions): void
|
||||
{
|
||||
/** @var \App\Models\Server $server */
|
||||
/** @var Server $server */
|
||||
[$user, $server] = $this->generateTestAccount($permissions);
|
||||
$this->assertTrue($server->isInstalled());
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Tests\Integration\Api\Client\Server\Startup;
|
||||
|
||||
use App\Enums\SubuserPermission;
|
||||
use App\Models\EggVariable;
|
||||
use App\Models\Server;
|
||||
use App\Models\User;
|
||||
use App\Tests\Integration\Api\Client\ClientApiIntegrationTestCase;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
@@ -17,7 +18,7 @@ class GetStartupAndVariablesTest extends ClientApiIntegrationTestCase
|
||||
#[DataProvider('permissionsDataProvider')]
|
||||
public function test_startup_variables_are_returned_for_server(array $permissions): void
|
||||
{
|
||||
/** @var \App\Models\Server $server */
|
||||
/** @var Server $server */
|
||||
[$user, $server] = $this->generateTestAccount($permissions);
|
||||
|
||||
$egg = $this->cloneEggAndVariables($server->egg);
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Tests\Integration\Api\Client\Server\Startup;
|
||||
|
||||
use App\Enums\SubuserPermission;
|
||||
use App\Models\EggVariable;
|
||||
use App\Models\Server;
|
||||
use App\Models\User;
|
||||
use App\Tests\Integration\Api\Client\ClientApiIntegrationTestCase;
|
||||
use Illuminate\Http\Response;
|
||||
@@ -17,7 +18,7 @@ class UpdateStartupVariableTest extends ClientApiIntegrationTestCase
|
||||
#[DataProvider('permissionsDataProvider')]
|
||||
public function test_startup_variable_can_be_updated(array $permissions): void
|
||||
{
|
||||
/** @var \App\Models\Server $server */
|
||||
/** @var Server $server */
|
||||
[$user, $server] = $this->generateTestAccount($permissions);
|
||||
$server->fill([
|
||||
'startup' => 'java {{SERVER_JARFILE}} --version {{BUNGEE_VERSION}}',
|
||||
@@ -51,7 +52,7 @@ class UpdateStartupVariableTest extends ClientApiIntegrationTestCase
|
||||
#[DataProvider('permissionsDataProvider')]
|
||||
public function test_startup_variable_cannot_be_updated_if_not_user_viewable_or_editable(array $permissions): void
|
||||
{
|
||||
/** @var \App\Models\Server $server */
|
||||
/** @var Server $server */
|
||||
[$user, $server] = $this->generateTestAccount($permissions);
|
||||
|
||||
$egg = $this->cloneEggAndVariables($server->egg);
|
||||
@@ -86,7 +87,7 @@ class UpdateStartupVariableTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_hidden_variables_are_not_returned_in_startup_command_when_updating_variable(): void
|
||||
{
|
||||
/** @var \App\Models\Server $server */
|
||||
/** @var Server $server */
|
||||
[$user, $server] = $this->generateTestAccount();
|
||||
|
||||
$egg = $this->cloneEggAndVariables($server->egg);
|
||||
@@ -115,7 +116,7 @@ class UpdateStartupVariableTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_egg_variable_with_nullable_string_is_not_required(): void
|
||||
{
|
||||
/** @var \App\Models\Server $server */
|
||||
/** @var Server $server */
|
||||
[$user, $server] = $this->generateTestAccount();
|
||||
|
||||
$egg = $this->cloneEggAndVariables($server->egg);
|
||||
|
||||
@@ -32,7 +32,7 @@ class CreateServerSubuserTest extends ClientApiIntegrationTestCase
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
/** @var \App\Models\User $subuser */
|
||||
/** @var User $subuser */
|
||||
$subuser = User::query()->where('email', $email)->firstOrFail();
|
||||
|
||||
$response->assertJsonPath('object', Subuser::RESOURCE_NAME);
|
||||
@@ -111,7 +111,7 @@ class CreateServerSubuserTest extends ClientApiIntegrationTestCase
|
||||
{
|
||||
[$user, $server] = $this->generateTestAccount();
|
||||
|
||||
/** @var \App\Models\User $existing */
|
||||
/** @var User $existing */
|
||||
$existing = User::factory()->create(['email' => $this->faker->email()]);
|
||||
|
||||
$response = $this->actingAs($user)->postJson($this->link($server) . '/users', [
|
||||
|
||||
@@ -26,14 +26,14 @@ class DeleteSubuserTest extends ClientApiIntegrationTestCase
|
||||
|
||||
[$user, $server] = $this->generateTestAccount();
|
||||
|
||||
/** @var \App\Models\User $differentUser */
|
||||
/** @var User $differentUser */
|
||||
$differentUser = User::factory()->create();
|
||||
|
||||
$real = Uuid::uuid4()->toString();
|
||||
// Generate a UUID that lines up with a user in the database if it were to be cast to an int.
|
||||
$uuid = $differentUser->id . substr($real, strlen((string) $differentUser->id));
|
||||
|
||||
/** @var \App\Models\User $subuser */
|
||||
/** @var User $subuser */
|
||||
$subuser = User::factory()->create(['uuid' => $uuid]);
|
||||
|
||||
Subuser::query()->forceCreate([
|
||||
@@ -49,7 +49,7 @@ class DeleteSubuserTest extends ClientApiIntegrationTestCase
|
||||
// Try the same test, but this time with a UUID that if cast to an int (shouldn't) line up with
|
||||
// anything in the database.
|
||||
$uuid = '18180000' . substr(Uuid::uuid4()->toString(), 8);
|
||||
/** @var \App\Models\User $subuser */
|
||||
/** @var User $subuser */
|
||||
$subuser = User::factory()->create(['uuid' => $uuid]);
|
||||
|
||||
Subuser::query()->forceCreate([
|
||||
|
||||
@@ -17,7 +17,7 @@ class SubuserAuthorizationTest extends ClientApiIntegrationTestCase
|
||||
public function test_user_cannot_access_resource_belonging_to_other_servers(string $method): void
|
||||
{
|
||||
// Generic subuser, the specific resource we're trying to access.
|
||||
/** @var \App\Models\User $internal */
|
||||
/** @var User $internal */
|
||||
$internal = User::factory()->create();
|
||||
|
||||
// The API $user is the owner of $server1.
|
||||
|
||||
@@ -64,7 +64,7 @@ class UpdateSubuserTest extends ClientApiIntegrationTestCase
|
||||
{
|
||||
[$user, $server] = $this->generateTestAccount();
|
||||
|
||||
/** @var \App\Models\Subuser $subuser */
|
||||
/** @var Subuser $subuser */
|
||||
$subuser = Subuser::factory()
|
||||
->for(User::factory()->create())
|
||||
->for($server)
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
namespace App\Tests\Integration\Api\Client\Server;
|
||||
|
||||
use App\Enums\SubuserPermission;
|
||||
use App\Models\Server;
|
||||
use App\Models\User;
|
||||
use App\Tests\Integration\Api\Client\ClientApiIntegrationTestCase;
|
||||
use Carbon\CarbonImmutable;
|
||||
use Illuminate\Http\Response;
|
||||
@@ -42,8 +44,8 @@ class WebsocketControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function test_jwt_and_websocket_url_are_returned_for_server_owner(): void
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var \App\Models\Server $server */
|
||||
/** @var User $user */
|
||||
/** @var Server $server */
|
||||
[$user, $server] = $this->generateTestAccount();
|
||||
|
||||
// Force the node to HTTPS since we want to confirm it gets transformed to wss:// in the URL.
|
||||
@@ -88,8 +90,8 @@ class WebsocketControllerTest extends ClientApiIntegrationTestCase
|
||||
{
|
||||
$permissions = [SubuserPermission::WebsocketConnect->value, SubuserPermission::ControlConsole->value];
|
||||
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var \App\Models\Server $server */
|
||||
/** @var User $user */
|
||||
/** @var Server $server */
|
||||
[$user, $server] = $this->generateTestAccount($permissions);
|
||||
|
||||
$response = $this->actingAs($user)->getJson("/api/client/servers/$server->uuid/websocket");
|
||||
|
||||
@@ -109,7 +109,7 @@ class DaemonAuthenticateTest extends MiddlewareTestCase
|
||||
* Provides different tokens that should trigger a bad request exception due to
|
||||
* their formatting.
|
||||
*
|
||||
* @return array|\string[][]
|
||||
* @return array|string[][]
|
||||
*/
|
||||
public static function badTokenDataProvider(): array
|
||||
{
|
||||
|
||||
@@ -24,14 +24,14 @@ class RunTaskJobTest extends IntegrationTestCase
|
||||
{
|
||||
$server = $this->createServerModel();
|
||||
|
||||
/** @var \App\Models\Schedule $schedule */
|
||||
/** @var Schedule $schedule */
|
||||
$schedule = Schedule::factory()->create([
|
||||
'server_id' => $server->id,
|
||||
'is_processing' => true,
|
||||
'last_run_at' => null,
|
||||
'is_active' => false,
|
||||
]);
|
||||
/** @var \App\Models\Task $task */
|
||||
/** @var Task $task */
|
||||
$task = Task::factory()->create(['schedule_id' => $schedule->id, 'is_queued' => true]);
|
||||
|
||||
$job = new RunTaskJob($task);
|
||||
@@ -51,9 +51,9 @@ class RunTaskJobTest extends IntegrationTestCase
|
||||
{
|
||||
$server = $this->createServerModel();
|
||||
|
||||
/** @var \App\Models\Schedule $schedule */
|
||||
/** @var Schedule $schedule */
|
||||
$schedule = Schedule::factory()->create(['server_id' => $server->id]);
|
||||
/** @var \App\Models\Task $task */
|
||||
/** @var Task $task */
|
||||
$task = Task::factory()->create(['schedule_id' => $schedule->id, 'action' => 'foobar']);
|
||||
|
||||
$job = new RunTaskJob($task);
|
||||
@@ -68,14 +68,14 @@ class RunTaskJobTest extends IntegrationTestCase
|
||||
{
|
||||
$server = $this->createServerModel();
|
||||
|
||||
/** @var \App\Models\Schedule $schedule */
|
||||
/** @var Schedule $schedule */
|
||||
$schedule = Schedule::factory()->create([
|
||||
'server_id' => $server->id,
|
||||
'is_active' => !$isManualRun,
|
||||
'is_processing' => true,
|
||||
'last_run_at' => null,
|
||||
]);
|
||||
/** @var \App\Models\Task $task */
|
||||
/** @var Task $task */
|
||||
$task = Task::factory()->create([
|
||||
'schedule_id' => $schedule->id,
|
||||
'action' => 'power',
|
||||
@@ -107,9 +107,9 @@ class RunTaskJobTest extends IntegrationTestCase
|
||||
{
|
||||
$server = $this->createServerModel();
|
||||
|
||||
/** @var \App\Models\Schedule $schedule */
|
||||
/** @var Schedule $schedule */
|
||||
$schedule = Schedule::factory()->create(['server_id' => $server->id]);
|
||||
/** @var \App\Models\Task $task */
|
||||
/** @var Task $task */
|
||||
$task = Task::factory()->create([
|
||||
'schedule_id' => $schedule->id,
|
||||
'action' => 'power',
|
||||
|
||||
@@ -37,13 +37,13 @@ class ProcessScheduleServiceTest extends IntegrationTestCase
|
||||
{
|
||||
$server = $this->createServerModel();
|
||||
|
||||
/** @var \App\Models\Schedule $schedule */
|
||||
/** @var Schedule $schedule */
|
||||
$schedule = Schedule::factory()->create([
|
||||
'server_id' => $server->id,
|
||||
'cron_minute' => 'hodor', // this will break the getNextRunDate() function.
|
||||
]);
|
||||
|
||||
/** @var \App\Models\Task $task */
|
||||
/** @var Task $task */
|
||||
$task = Task::factory()->create(['schedule_id' => $schedule->id, 'sequence_id' => 1]);
|
||||
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
@@ -64,10 +64,10 @@ class ProcessScheduleServiceTest extends IntegrationTestCase
|
||||
|
||||
$server = $this->createServerModel();
|
||||
|
||||
/** @var \App\Models\Schedule $schedule */
|
||||
/** @var Schedule $schedule */
|
||||
$schedule = Schedule::factory()->create(['server_id' => $server->id]);
|
||||
|
||||
/** @var \App\Models\Task $task */
|
||||
/** @var Task $task */
|
||||
$task = Task::factory()->create(['schedule_id' => $schedule->id, 'time_offset' => 10, 'sequence_id' => 1]);
|
||||
|
||||
$this->getService()->handle($schedule, $now);
|
||||
@@ -94,10 +94,10 @@ class ProcessScheduleServiceTest extends IntegrationTestCase
|
||||
Bus::fake();
|
||||
|
||||
$server = $this->createServerModel();
|
||||
/** @var \App\Models\Schedule $schedule */
|
||||
/** @var Schedule $schedule */
|
||||
$schedule = Schedule::factory()->create(['server_id' => $server->id]);
|
||||
|
||||
/** @var \App\Models\Task $task */
|
||||
/** @var Task $task */
|
||||
$task2 = Task::factory()->create(['schedule_id' => $schedule->id, 'sequence_id' => 4]);
|
||||
$task = Task::factory()->create(['schedule_id' => $schedule->id, 'sequence_id' => 2]);
|
||||
$task3 = Task::factory()->create(['schedule_id' => $schedule->id, 'sequence_id' => 3]);
|
||||
@@ -123,14 +123,14 @@ class ProcessScheduleServiceTest extends IntegrationTestCase
|
||||
$this->swap(Dispatcher::class, $dispatcher = \Mockery::mock(Dispatcher::class));
|
||||
|
||||
$server = $this->createServerModel();
|
||||
/** @var \App\Models\Schedule $schedule */
|
||||
/** @var Schedule $schedule */
|
||||
$schedule = Schedule::factory()->create(['server_id' => $server->id, 'last_run_at' => null]);
|
||||
/** @var \App\Models\Task $task */
|
||||
/** @var Task $task */
|
||||
$task = Task::factory()->create(['schedule_id' => $schedule->id, 'sequence_id' => 1]);
|
||||
|
||||
$dispatcher->expects('dispatchNow')->andThrows(new \Exception('Test thrown exception'));
|
||||
$dispatcher->expects('dispatchNow')->andThrows(new Exception('Test thrown exception'));
|
||||
|
||||
$this->expectException(\Exception::class);
|
||||
$this->expectException(Exception::class);
|
||||
$this->expectExceptionMessage('Test thrown exception');
|
||||
|
||||
$this->getService()->handle($schedule, true);
|
||||
|
||||
@@ -34,7 +34,7 @@ class BuildModificationServiceTest extends IntegrationTestCase
|
||||
$server = $this->createServerModel();
|
||||
$server2 = $this->createServerModel();
|
||||
|
||||
/** @var \App\Models\Allocation[] $allocations */
|
||||
/** @var Allocation[] $allocations */
|
||||
$allocations = Allocation::factory()->times(4)->create(['node_id' => $server->node_id, 'notes' => 'Random notes']);
|
||||
|
||||
$initialAllocationId = $server->allocation_id;
|
||||
@@ -175,7 +175,7 @@ class BuildModificationServiceTest extends IntegrationTestCase
|
||||
public function test_no_exception_is_thrown_if_only_removing_allocation(): void
|
||||
{
|
||||
$server = $this->createServerModel();
|
||||
/** @var \App\Models\Allocation $allocation */
|
||||
/** @var Allocation $allocation */
|
||||
$allocation = Allocation::factory()->create(['node_id' => $server->node_id, 'server_id' => $server->id]);
|
||||
|
||||
$this->daemonServerRepository->expects('setServer->sync')->andReturnUndefined();
|
||||
@@ -198,7 +198,7 @@ class BuildModificationServiceTest extends IntegrationTestCase
|
||||
public function test_allocation_in_both_add_and_remove_is_added(): void
|
||||
{
|
||||
$server = $this->createServerModel();
|
||||
/** @var \App\Models\Allocation $allocation */
|
||||
/** @var Allocation $allocation */
|
||||
$allocation = Allocation::factory()->create(['node_id' => $server->node_id]);
|
||||
|
||||
$this->daemonServerRepository->expects('setServer->sync')->andReturnUndefined();
|
||||
@@ -217,9 +217,9 @@ class BuildModificationServiceTest extends IntegrationTestCase
|
||||
public function test_using_same_allocation_id_multiple_times_does_not_error(): void
|
||||
{
|
||||
$server = $this->createServerModel();
|
||||
/** @var \App\Models\Allocation $allocation */
|
||||
/** @var Allocation $allocation */
|
||||
$allocation = Allocation::factory()->create(['node_id' => $server->node_id, 'server_id' => $server->id]);
|
||||
/** @var \App\Models\Allocation $allocation2 */
|
||||
/** @var Allocation $allocation2 */
|
||||
$allocation2 = Allocation::factory()->create(['node_id' => $server->node_id]);
|
||||
|
||||
$this->daemonServerRepository->expects('setServer->sync')->andReturnUndefined();
|
||||
@@ -242,7 +242,7 @@ class BuildModificationServiceTest extends IntegrationTestCase
|
||||
public function test_that_updates_are_rolled_back_if_exception_is_encountered(): void
|
||||
{
|
||||
$server = $this->createServerModel();
|
||||
/** @var \App\Models\Allocation $allocation */
|
||||
/** @var Allocation $allocation */
|
||||
$allocation = Allocation::factory()->create(['node_id' => $server->node_id]);
|
||||
|
||||
$this->daemonServerRepository->expects('setServer->sync')->andThrows(new DisplayException('Test'));
|
||||
|
||||
@@ -11,6 +11,7 @@ use App\Models\User;
|
||||
use App\Repositories\Daemon\DaemonServerRepository;
|
||||
use App\Services\Servers\ServerCreationService;
|
||||
use App\Tests\Integration\IntegrationTestCase;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Http\Client\ConnectionException;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
@@ -50,13 +51,13 @@ class ServerCreationServiceTest extends IntegrationTestCase
|
||||
*/
|
||||
public function test_server_is_created_with_deployment_object(): void
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
|
||||
/** @var \App\Models\Node $node */
|
||||
/** @var Node $node */
|
||||
$node = Node::factory()->create();
|
||||
|
||||
/** @var \App\Models\Allocation[]|\Illuminate\Database\Eloquent\Collection $allocations */
|
||||
/** @var Allocation[]|Collection $allocations */
|
||||
$allocations = Allocation::factory()->times(5)->create([
|
||||
'node_id' => $node->id,
|
||||
]);
|
||||
@@ -148,10 +149,10 @@ class ServerCreationServiceTest extends IntegrationTestCase
|
||||
*/
|
||||
public function test_server_without_allocation_is_created_with_deployment_object(): void
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
|
||||
/** @var \App\Models\Node $node */
|
||||
/** @var Node $node */
|
||||
$node = Node::factory()->create();
|
||||
|
||||
$deployment = new DeploymentObject();
|
||||
@@ -235,13 +236,13 @@ class ServerCreationServiceTest extends IntegrationTestCase
|
||||
*/
|
||||
public function test_error_encountered_by_daemon_causes_server_to_be_deleted(): void
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
|
||||
/** @var \App\Models\Node $node */
|
||||
/** @var Node $node */
|
||||
$node = Node::factory()->create();
|
||||
|
||||
/** @var \App\Models\Allocation $allocation */
|
||||
/** @var Allocation $allocation */
|
||||
$allocation = Allocation::factory()->create([
|
||||
'node_id' => $node->id,
|
||||
]);
|
||||
|
||||
@@ -103,7 +103,7 @@ class ServerDeletionServiceTest extends IntegrationTestCase
|
||||
$server = $this->createServerModel();
|
||||
$host = DatabaseHost::factory()->create();
|
||||
|
||||
/** @var \App\Models\Database $db */
|
||||
/** @var Database $db */
|
||||
$db = Database::factory()->create(['database_host_id' => $host->id, 'server_id' => $server->id]);
|
||||
|
||||
$server->refresh();
|
||||
@@ -128,7 +128,7 @@ class ServerDeletionServiceTest extends IntegrationTestCase
|
||||
$server = $this->createServerModel();
|
||||
$host = DatabaseHost::factory()->create();
|
||||
|
||||
/** @var \App\Models\Database $db */
|
||||
/** @var Database $db */
|
||||
$db = Database::factory()->create(['database_host_id' => $host->id, 'server_id' => $server->id]);
|
||||
|
||||
$server->refresh();
|
||||
|
||||
@@ -36,7 +36,7 @@ class StartupModificationServiceTest extends IntegrationTestCase
|
||||
} catch (\Exception $exception) {
|
||||
$this->assertInstanceOf(ValidationException::class, $exception);
|
||||
|
||||
/** @var \Illuminate\Validation\ValidationException $exception */
|
||||
/** @var ValidationException $exception */
|
||||
$errors = $exception->validator->errors()->toArray();
|
||||
|
||||
$this->assertCount(1, $errors);
|
||||
@@ -69,7 +69,7 @@ class StartupModificationServiceTest extends IntegrationTestCase
|
||||
*/
|
||||
public function test_server_is_properly_modified_as_admin_user(): void
|
||||
{
|
||||
/** @var \App\Models\Egg $nextEgg */
|
||||
/** @var Egg $nextEgg */
|
||||
$nextEgg = Egg::query()->findOrFail(2);
|
||||
|
||||
$server = $this->createServerModel(['egg_id' => 1]);
|
||||
|
||||
@@ -65,7 +65,7 @@ function something()
|
||||
* is assumed that the user is actually a subuser of the server.
|
||||
*
|
||||
* @param string[] $permissions
|
||||
* @return array{\App\Models\User, \App\Models\Server}
|
||||
* @return array{User, Server}
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -82,19 +82,19 @@ function createServerModel(array $attributes = []): Server
|
||||
}
|
||||
|
||||
if (!isset($attributes['owner_id'])) {
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
$attributes['owner_id'] = $user->id;
|
||||
}
|
||||
|
||||
if (!isset($attributes['node_id'])) {
|
||||
/** @var \App\Models\Node $node */
|
||||
/** @var Node $node */
|
||||
$node = Node::factory()->create();
|
||||
$attributes['node_id'] = $node->id;
|
||||
}
|
||||
|
||||
if (!isset($attributes['allocation_id'])) {
|
||||
/** @var \App\Models\Allocation $allocation */
|
||||
/** @var Allocation $allocation */
|
||||
$allocation = Allocation::factory()->create(['node_id' => $attributes['node_id']]);
|
||||
$attributes['allocation_id'] = $allocation->id;
|
||||
}
|
||||
@@ -107,7 +107,7 @@ function createServerModel(array $attributes = []): Server
|
||||
|
||||
unset($attributes['user_id']);
|
||||
|
||||
/** @var \App\Models\Server $server */
|
||||
/** @var Server $server */
|
||||
$server = Server::factory()->create($attributes);
|
||||
|
||||
Allocation::query()->where('id', $server->allocation_id)->update(['server_id' => $server->id]);
|
||||
@@ -122,11 +122,11 @@ function createServerModel(array $attributes = []): Server
|
||||
* is assumed that the user is actually a subuser of the server.
|
||||
*
|
||||
* @param string[] $permissions
|
||||
* @return array{\App\Models\User, \App\Models\Server}
|
||||
* @return array{User, Server}
|
||||
*/
|
||||
function generateTestAccount(array $permissions = []): array
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
|
||||
if (empty($permissions)) {
|
||||
@@ -154,7 +154,7 @@ function cloneEggAndVariables(Egg $egg): Egg
|
||||
$model->uuid = Uuid::uuid4()->toString();
|
||||
$model->push();
|
||||
|
||||
/** @var \App\Models\Egg $model */
|
||||
/** @var Egg $model */
|
||||
$model = $model->fresh();
|
||||
|
||||
foreach ($egg->variables as $variable) {
|
||||
@@ -170,7 +170,7 @@ function cloneEggAndVariables(Egg $egg): Egg
|
||||
*/
|
||||
function getBungeecordEgg(): Egg
|
||||
{
|
||||
/** @var \App\Models\Egg $egg */
|
||||
/** @var Egg $egg */
|
||||
$egg = Egg::query()->where('author', 'panel@example.com')->where('name', 'Bungeecord')->firstOrFail();
|
||||
|
||||
return $egg;
|
||||
|
||||
@@ -11,7 +11,7 @@ trait MocksMiddlewareClosure
|
||||
* Provide a closure to be used when validating that the response from the middleware
|
||||
* is the same request object we passed into it.
|
||||
*/
|
||||
protected function getClosureAssertions(): \Closure
|
||||
protected function getClosureAssertions(): Closure
|
||||
{
|
||||
if (is_null($this->request)) {
|
||||
throw new \BadFunctionCallException('Calling getClosureAssertions without defining a request object is not supported.');
|
||||
|
||||
@@ -27,19 +27,19 @@ trait CreatesTestModels
|
||||
}
|
||||
|
||||
if (!isset($attributes['owner_id'])) {
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
$attributes['owner_id'] = $user->id;
|
||||
}
|
||||
|
||||
if (!isset($attributes['node_id'])) {
|
||||
/** @var \App\Models\Node $node */
|
||||
/** @var Node $node */
|
||||
$node = Node::factory()->create();
|
||||
$attributes['node_id'] = $node->id;
|
||||
}
|
||||
|
||||
if (!isset($attributes['allocation_id'])) {
|
||||
/** @var \App\Models\Allocation $allocation */
|
||||
/** @var Allocation $allocation */
|
||||
$allocation = Allocation::factory()->create(['node_id' => $attributes['node_id']]);
|
||||
$attributes['allocation_id'] = $allocation->id;
|
||||
}
|
||||
@@ -52,7 +52,7 @@ trait CreatesTestModels
|
||||
|
||||
unset($attributes['user_id']);
|
||||
|
||||
/** @var \App\Models\Server $server */
|
||||
/** @var Server $server */
|
||||
$server = Server::factory()->create($attributes);
|
||||
|
||||
Allocation::query()->where('id', $server->allocation_id)->update(['server_id' => $server->id]);
|
||||
@@ -67,11 +67,11 @@ trait CreatesTestModels
|
||||
* is assumed that the user is actually a subuser of the server.
|
||||
*
|
||||
* @param array<string|SubuserPermission> $permissions
|
||||
* @return array{\App\Models\User, \App\Models\Server}
|
||||
* @return array{User, Server}
|
||||
*/
|
||||
public function generateTestAccount(array $permissions = []): array
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
|
||||
if (empty($permissions)) {
|
||||
@@ -99,7 +99,7 @@ trait CreatesTestModels
|
||||
$model->uuid = Uuid::uuid4()->toString();
|
||||
$model->push();
|
||||
|
||||
/** @var \App\Models\Egg $model */
|
||||
/** @var Egg $model */
|
||||
$model = $model->fresh();
|
||||
|
||||
foreach ($egg->variables as $variable) {
|
||||
@@ -115,7 +115,7 @@ trait CreatesTestModels
|
||||
*/
|
||||
private function getBungeecordEgg(): Egg
|
||||
{
|
||||
/** @var \App\Models\Egg $egg */
|
||||
/** @var Egg $egg */
|
||||
$egg = Egg::query()->where('author', 'panel@example.com')->where('name', 'Bungeecord')->firstOrFail();
|
||||
|
||||
return $egg;
|
||||
|
||||
@@ -23,7 +23,7 @@ trait MocksPdoConnection
|
||||
|
||||
Model::unsetConnectionResolver();
|
||||
|
||||
$connection = new MySqlConnection($mock = \Mockery::mock(\PDO::class), 'testing_mock');
|
||||
$connection = new MySqlConnection($mock = Mockery::mock(PDO::class), 'testing_mock');
|
||||
$resolver = new ConnectionResolver(['mocked' => $connection]);
|
||||
$resolver->setDefaultConnection('mocked');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user