mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-07 17:02:34 +00:00
@ -6,6 +6,7 @@
|
||||
use App\Helpers\Notifier;
|
||||
use App\Helpers\SSH;
|
||||
use App\Models\PersonalAccessToken;
|
||||
use App\Plugins\Plugins;
|
||||
use Illuminate\Http\Resources\Json\ResourceCollection;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Laravel\Fortify\Fortify;
|
||||
@ -29,6 +30,7 @@ public function boot(): void
|
||||
$this->app->bind('ssh', fn (): SSH => new SSH);
|
||||
$this->app->bind('notifier', fn (): Notifier => new Notifier);
|
||||
$this->app->bind('ftp', fn (): FTP => new FTP);
|
||||
$this->app->bind('plugins', fn (): Plugins => new Plugins);
|
||||
|
||||
Sanctum::usePersonalAccessTokenModel(PersonalAccessToken::class);
|
||||
}
|
||||
|
30
app/Providers/PluginsServiceProvider.php
Normal file
30
app/Providers/PluginsServiceProvider.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Console\Commands\Plugins\InstallPluginCommand;
|
||||
use App\Console\Commands\Plugins\LoadPluginsCommand;
|
||||
use App\Console\Commands\Plugins\PluginsListCommand;
|
||||
use App\Plugins\Plugins;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class PluginsServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->bind('plugins', function () {
|
||||
return new Plugins;
|
||||
});
|
||||
}
|
||||
|
||||
public function boot(): void
|
||||
{
|
||||
if ($this->app->runningInConsole()) {
|
||||
$this->commands([
|
||||
InstallPluginCommand::class,
|
||||
LoadPluginsCommand::class,
|
||||
PluginsListCommand::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
@ -5,11 +5,7 @@
|
||||
use App\DTOs\DynamicField;
|
||||
use App\DTOs\DynamicForm;
|
||||
use App\Enums\LoadBalancerMethod;
|
||||
use App\Plugins\RegisterSiteFeature;
|
||||
use App\Plugins\RegisterSiteFeatureAction;
|
||||
use App\Plugins\RegisterSiteType;
|
||||
use App\SiteFeatures\LaravelOctane\Disable;
|
||||
use App\SiteFeatures\LaravelOctane\Enable;
|
||||
use App\SiteTypes\Laravel;
|
||||
use App\SiteTypes\LoadBalancer;
|
||||
use App\SiteTypes\PHPBlank;
|
||||
@ -114,29 +110,6 @@ private function laravel(): void
|
||||
->default(false),
|
||||
]))
|
||||
->register();
|
||||
RegisterSiteFeature::make('laravel', 'laravel-octane')
|
||||
->label('Laravel Octane')
|
||||
->description('Enable Laravel Octane for this site')
|
||||
->register();
|
||||
RegisterSiteFeatureAction::make('laravel', 'laravel-octane', 'enable')
|
||||
->label('Enable')
|
||||
->form(DynamicForm::make([
|
||||
DynamicField::make('alert')
|
||||
->alert()
|
||||
->label('Alert')
|
||||
->description('Make sure you have already set the `OCTANE_SERVER` in your `.env` file'),
|
||||
DynamicField::make('port')
|
||||
->text()
|
||||
->label('Octane Port')
|
||||
->default(8000)
|
||||
->description('The port on which Laravel Octane will run.'),
|
||||
]))
|
||||
->handler(Enable::class)
|
||||
->register();
|
||||
RegisterSiteFeatureAction::make('laravel', 'laravel-octane', 'disable')
|
||||
->label('Disable')
|
||||
->handler(Disable::class)
|
||||
->register();
|
||||
}
|
||||
|
||||
public function loadBalancer(): void
|
||||
|
Reference in New Issue
Block a user