Skip to content

Commit

Permalink
Merge branch 'dev' into updateModuleStub
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeelio authored May 24, 2024
2 parents 472381d + 36f79e7 commit afc794b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/Http/Controllers/Api/MaintenanceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace App\Http\Controllers\Api;

use App\Console\Cron;
use App\Console\Kernel;
use App\Contracts\Controller;
use App\Exceptions\CronInvalid;
use Illuminate\Http\JsonResponse;
Expand All @@ -25,6 +26,15 @@ public function cron(Request $request, string $id): JsonResponse
throw new CronInvalid();
}

// Create a console kernel instance
$consoleKernel = app()->make(Kernel::class);

// Run a null artisan thing just so Laravel internals can be setup properly
$status = $consoleKernel->handle(
new \Symfony\Component\Console\Input\ArgvInput(),
new \Symfony\Component\Console\Output\NullOutput()
);

$cron = app(Cron::class);
$run = $cron->run();

Expand Down

0 comments on commit afc794b

Please sign in to comment.