mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 16:22:14 +00:00
auto delete all shared links every day in demo mode
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
APP_NAME=Laravel
|
APP_NAME=Laravel
|
||||||
APP_ENV=local
|
APP_ENV=local
|
||||||
APP_KEY=base64:SrIyY45mJQvvP8DTufIDcTRptGHFka0jT+QCsAj1yI4=
|
APP_KEY=base64:Dau44h6D3cJyjYdcbJ2ZjEf52oKR5xqjQ4BrJykCh0g=
|
||||||
APP_DEBUG=true
|
APP_DEBUG=true
|
||||||
APP_URL=http://localhost
|
APP_URL=http://localhost
|
||||||
APP_DEMO=false
|
APP_DEMO=false
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ use Illuminate\Console\Scheduling\Schedule;
|
|||||||
use App\Console\Commands\SetupDevEnvironment;
|
use App\Console\Commands\SetupDevEnvironment;
|
||||||
use App\Console\Commands\SetupProdEnvironment;
|
use App\Console\Commands\SetupProdEnvironment;
|
||||||
use Support\Scheduler\Actions\ReportUsageAction;
|
use Support\Scheduler\Actions\ReportUsageAction;
|
||||||
|
use Support\Demo\Actions\DeleteAllSharedLinksAction;
|
||||||
use Support\Scheduler\Actions\DeleteFailedFilesAction;
|
use Support\Scheduler\Actions\DeleteFailedFilesAction;
|
||||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||||
use Support\Scheduler\Actions\DeleteUnverifiedUsersAction;
|
use Support\Scheduler\Actions\DeleteUnverifiedUsersAction;
|
||||||
@@ -39,6 +40,12 @@ class Kernel extends ConsoleKernel
|
|||||||
)->everySixHours();
|
)->everySixHours();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_demo()) {
|
||||||
|
$schedule->call(
|
||||||
|
fn () => resolve(DeleteAllSharedLinksAction::class)()
|
||||||
|
)->daily()->at('00:00');
|
||||||
|
}
|
||||||
|
|
||||||
$schedule->call(
|
$schedule->call(
|
||||||
fn () => resolve(DeleteExpiredShareLinksAction::class)()
|
fn () => resolve(DeleteExpiredShareLinksAction::class)()
|
||||||
)->everyTenMinutes();
|
)->everyTenMinutes();
|
||||||
|
|||||||
12
src/Support/Demo/Actions/DeleteAllSharedLinksAction.php
Normal file
12
src/Support/Demo/Actions/DeleteAllSharedLinksAction.php
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
namespace Support\Demo\Actions;
|
||||||
|
|
||||||
|
use DB;
|
||||||
|
|
||||||
|
class DeleteAllSharedLinksAction
|
||||||
|
{
|
||||||
|
public function __invoke()
|
||||||
|
{
|
||||||
|
DB::table('shares')->delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user