action(function () { Artisan::call(CheckForUpdates::class); }) ->label('Check for updates'), ]; } public function update(): Action { return Action::make('update') ->requiresConfirmation() ->action(function () { $output = new BufferedOutput; // Check if current chdir is the root of the project if (getcwd() !== base_path()) { chdir(base_path()); } if (config('app.version') == 'beta') { Artisan::call(Upgrade::class, ['--no-interaction' => true, '--url' => 'https://api.paymenter.org/beta'], $output); } else { Artisan::call(Upgrade::class, ['--no-interaction' => true], $output); } $this->dispatch('update-completed', [ 'output' => $output->fetch(), ]); }) ->label('Update'); } public static function canAccess(): bool { return auth()->check() && auth()->user()->hasPermission('admin.updates.update'); } }