Composer format & run action
This commit is contained in:
@@ -15,4 +15,5 @@ return (new PhpCsFixer\Config)
|
|||||||
'ordered_imports' => ['sort_algorithm' => 'length'],
|
'ordered_imports' => ['sort_algorithm' => 'length'],
|
||||||
'no_unused_imports' => true,
|
'no_unused_imports' => true,
|
||||||
])
|
])
|
||||||
|
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
|
||||||
->setFinder($finder);
|
->setFinder($finder);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class SynchronizeServerAction
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$serverData){
|
if (!$serverData) {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title('Server synchronization')
|
->title('Server synchronization')
|
||||||
->body('It was not possible to synchronize servers, it seems the API key has the wrong scopes. Please make sure the Ploi API key you\'ve entered has all the scopes enabled.')
|
->body('It was not possible to synchronize servers, it seems the API key has the wrong scopes. Please make sure the Ploi API key you\'ve entered has all the scopes enabled.')
|
||||||
|
|||||||
@@ -11,20 +11,19 @@ use Illuminate\Support\Arr;
|
|||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use App\Services\VersionChecker;
|
use App\Services\VersionChecker;
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
use Illuminate\Support\Facades\Http;
|
|
||||||
use Illuminate\Support\Facades\Artisan;
|
|
||||||
use function Laravel\Prompts\text;
|
|
||||||
use function Laravel\Prompts\password;
|
|
||||||
use function Laravel\Prompts\confirm;
|
|
||||||
use function Laravel\Prompts\select;
|
|
||||||
use function Laravel\Prompts\info;
|
use function Laravel\Prompts\info;
|
||||||
use function Laravel\Prompts\error;
|
|
||||||
use function Laravel\Prompts\warning;
|
|
||||||
use function Laravel\Prompts\note;
|
use function Laravel\Prompts\note;
|
||||||
use function Laravel\Prompts\spin;
|
use function Laravel\Prompts\spin;
|
||||||
|
use function Laravel\Prompts\text;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use function Laravel\Prompts\error;
|
||||||
use function Laravel\Prompts\intro;
|
use function Laravel\Prompts\intro;
|
||||||
use function Laravel\Prompts\outro;
|
use function Laravel\Prompts\outro;
|
||||||
|
use function Laravel\Prompts\select;
|
||||||
|
use Illuminate\Support\Facades\Http;
|
||||||
|
use function Laravel\Prompts\confirm;
|
||||||
|
use function Laravel\Prompts\warning;
|
||||||
|
use function Laravel\Prompts\password;
|
||||||
|
|
||||||
class Install extends Command
|
class Install extends Command
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ namespace App\Filament\Resources\AlertResource\Pages;
|
|||||||
use Filament\Actions;
|
use Filament\Actions;
|
||||||
use App\Filament\Resources\AlertResource;
|
use App\Filament\Resources\AlertResource;
|
||||||
use Filament\Resources\Pages\ListRecords;
|
use Filament\Resources\Pages\ListRecords;
|
||||||
use Illuminate\Contracts\Support\Htmlable;
|
|
||||||
|
|
||||||
class ListAlerts extends ListRecords
|
class ListAlerts extends ListRecords
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,18 +2,18 @@
|
|||||||
|
|
||||||
namespace App\Filament\Resources;
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
use App\Filament\Resources\PackageResource\Pages;
|
use Filament\Forms;
|
||||||
use App\Filament\Resources\PackageResource\RelationManagers;
|
use Filament\Tables;
|
||||||
use App\Models\Package;
|
use App\Models\Package;
|
||||||
use App\Models\Provider;
|
use App\Models\Provider;
|
||||||
use App\Models\ProviderPlan;
|
|
||||||
use Filament\Forms;
|
|
||||||
use Filament\Forms\Form;
|
use Filament\Forms\Form;
|
||||||
use Filament\Notifications\Notification;
|
|
||||||
use Filament\Resources\Resource;
|
|
||||||
use Filament\Tables;
|
|
||||||
use Filament\Tables\Table;
|
use Filament\Tables\Table;
|
||||||
|
use App\Models\ProviderPlan;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
use Illuminate\Support\HtmlString;
|
use Illuminate\Support\HtmlString;
|
||||||
|
use Filament\Notifications\Notification;
|
||||||
|
use App\Filament\Resources\PackageResource\Pages;
|
||||||
|
use App\Filament\Resources\PackageResource\RelationManagers;
|
||||||
|
|
||||||
class PackageResource extends Resource
|
class PackageResource extends Resource
|
||||||
{
|
{
|
||||||
@@ -134,8 +134,8 @@ class PackageResource extends Resource
|
|||||||
}),
|
}),
|
||||||
Forms\Components\CheckboxList::make("provider_plans")
|
Forms\Components\CheckboxList::make("provider_plans")
|
||||||
->label(__('Select plans'))
|
->label(__('Select plans'))
|
||||||
->options(fn() => $provider->plans->mapWithKeys(fn(ProviderPlan $providerPlan) => [$providerPlan->id => $providerPlan->label ?? $providerPlan->plan_id])->all())
|
->options(fn () => $provider->plans->mapWithKeys(fn (ProviderPlan $providerPlan) => [$providerPlan->id => $providerPlan->label ?? $providerPlan->plan_id])->all())
|
||||||
->visible(fn(Forms\Get $get) => $get('select_specific_provider_plans'))
|
->visible(fn (Forms\Get $get) => $get('select_specific_provider_plans'))
|
||||||
->reactive()
|
->reactive()
|
||||||
->bulkToggleable()
|
->bulkToggleable()
|
||||||
->columns(2)
|
->columns(2)
|
||||||
@@ -174,20 +174,20 @@ class PackageResource extends Resource
|
|||||||
->color('gray')
|
->color('gray')
|
||||||
->disabled(function (Package $record, Forms\Get $get) {
|
->disabled(function (Package $record, Forms\Get $get) {
|
||||||
$providers = collect($get('providers'))
|
$providers = collect($get('providers'))
|
||||||
->map(fn(string $id): int => (int)$id)
|
->map(fn (string $id): int => (int)$id)
|
||||||
->sort();
|
->sort();
|
||||||
|
|
||||||
return $record->providers->pluck('id')->map(fn(string $id): int => (int)$id)->sort()->toArray() !== $providers->all();
|
return $record->providers->pluck('id')->map(fn (string $id): int => (int)$id)->sort()->toArray() !== $providers->all();
|
||||||
})
|
})
|
||||||
]),
|
]),
|
||||||
Forms\Components\Placeholder::make('save_warning')
|
Forms\Components\Placeholder::make('save_warning')
|
||||||
->content(__('You\'ve changed the available server providers. Please save your changes before you can manage the provider plans.'))
|
->content(__('You\'ve changed the available server providers. Please save your changes before you can manage the provider plans.'))
|
||||||
->visible(function (Package $record, Forms\Get $get) {
|
->visible(function (Package $record, Forms\Get $get) {
|
||||||
$providers = collect($get('providers'))
|
$providers = collect($get('providers'))
|
||||||
->map(fn(string $id): int => (int)$id)
|
->map(fn (string $id): int => (int)$id)
|
||||||
->sort();
|
->sort();
|
||||||
|
|
||||||
return $record->providers->pluck('id')->map(fn(string $id): int => (int)$id)->sort()->toArray() !== $providers->all();
|
return $record->providers->pluck('id')->map(fn (string $id): int => (int)$id)->sort()->toArray() !== $providers->all();
|
||||||
})
|
})
|
||||||
->hiddenLabel(),
|
->hiddenLabel(),
|
||||||
])
|
])
|
||||||
@@ -218,10 +218,10 @@ class PackageResource extends Resource
|
|||||||
return "Attached to stripe - {$record->price_monthly} {$record->currency}";
|
return "Attached to stripe - {$record->price_monthly} {$record->currency}";
|
||||||
}),
|
}),
|
||||||
Tables\Columns\TextColumn::make('maximum_sites')
|
Tables\Columns\TextColumn::make('maximum_sites')
|
||||||
->formatStateUsing(fn(int $state) => $state === 0 ? __('Unlimited') : $state)
|
->formatStateUsing(fn (int $state) => $state === 0 ? __('Unlimited') : $state)
|
||||||
->label(__('Maximum sites')),
|
->label(__('Maximum sites')),
|
||||||
Tables\Columns\TextColumn::make('maximum_servers')
|
Tables\Columns\TextColumn::make('maximum_servers')
|
||||||
->formatStateUsing(fn(int $state) => $state === 0 ? __('Unlimited') : $state)
|
->formatStateUsing(fn (int $state) => $state === 0 ? __('Unlimited') : $state)
|
||||||
->label(__('Maximum servers')),
|
->label(__('Maximum servers')),
|
||||||
Tables\Columns\TextColumn::make('users_count')
|
Tables\Columns\TextColumn::make('users_count')
|
||||||
->counts('users'),
|
->counts('users'),
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Filament\Notifications\Notification;
|
|
||||||
use stdClass;
|
use stdClass;
|
||||||
use Sushi\Sushi;
|
use Sushi\Sushi;
|
||||||
use App\Services\Ploi\Ploi;
|
use App\Services\Ploi\Ploi;
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Filament\Notifications\Notification;
|
||||||
|
|
||||||
class AvailableServer extends Model
|
class AvailableServer extends Model
|
||||||
{
|
{
|
||||||
@@ -31,7 +31,7 @@ class AvailableServer extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
return collect($availableServers)
|
return collect($availableServers)
|
||||||
->map(fn(stdClass $server): array => Arr::only((array)$server, ['id', 'name', 'ip_address', 'sites_count']))
|
->map(fn (stdClass $server): array => Arr::only((array)$server, ['id', 'name', 'ip_address', 'sites_count']))
|
||||||
->all();
|
->all();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,8 +68,7 @@ class Site extends Resource
|
|||||||
string $projectRoot = '/',
|
string $projectRoot = '/',
|
||||||
string $systemUser = 'ploi',
|
string $systemUser = 'ploi',
|
||||||
string $systemUserPassword = null
|
string $systemUserPassword = null
|
||||||
): stdClass
|
): stdClass {
|
||||||
{
|
|
||||||
// Remove the id
|
// Remove the id
|
||||||
$this->setId(null);
|
$this->setId(null);
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ use Closure;
|
|||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Models\Package;
|
use App\Models\Package;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Illuminate\Support\Facades\Hash;
|
|
||||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
|
||||||
class UserFactory extends Factory
|
class UserFactory extends Factory
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
return new class extends Migration
|
return new class extends Migration {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Run the migrations.
|
* Run the migrations.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
return new class extends Migration
|
return new class extends Migration {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Run the migrations.
|
* Run the migrations.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
return new class extends Migration
|
return new class extends Migration {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Run the migrations.
|
* Run the migrations.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user