<?php

namespace App\Http\Controllers;

use App\Services\UpdateService;
use Illuminate\Http\Request;

class UpdateController extends Controller
{
    private $updates = [
        'update_to_2_4_0',
        'update_to_2_5_0',
        'update_to_2_6_0',
        'update_to_2_7_3',
    ];

    public function update(Request $request)
    {
        foreach ($this->updates as $update) {
            call_user_func([UpdateService::class, $update]);
        }

        return redirect()->back()->with('updateStatus', true);
    }
}
