--- /dev/null
+<?php
+
+namespace App\Console\Commands;
+
+use App\Console\Commands\Base\ToolboxCommand;
+use App\Fluidbook\Packager\Download;
+use App\Models\FluidbookPublication;
+use Cubist\Util\Text;
+
+class FluidbookHostAbuse extends ToolboxCommand
+{
+ protected $signature = 'fluidbook:hosting:abuse {id}';
+ protected $description = 'Move fluidbook to a temporary hosting';
+
+ public function handle()
+ {
+ $ids = Text::multiExplode(' ,', $this->argument('id', ''));
+
+ foreach ($ids as $id) {
+ /** @var FluidbookPublication $fb */
+ $fb = FluidbookPublication::withoutGlobalScopes()->find($id);
+ $fb->install_online = ['server' => 43, 'path' => $id];
+ $fb->saveQuietly();
+
+ $download = new Download($fb, 'online', 'install', $this->getUser());
+ $download->handle();
+
+ $fb->redirectDemo = 'https://abuse.hosting2.fluidbook.com/' . $id . '/';
+ $fb->saveQuietly();
+ }
+ }
+}