ForRo/app/Http/Controllers/LocationController.php
ro 7abd6d44a0 Data collection script overhaul
The script for collection blocklist info was getting a little heavy, so
it's been split in two to make it more accessible and easier to
maintain. The first part collects data from current sources and stores
it for the second part of the script, which compiles all the data and
updated the database.

The Source model was expanded to track votes so block and silence counts
can be easily verified on the backend.
2024-02-17 19:33:35 -06:00

36 lines
612 B
PHP

<?php
namespace App\Http\Controllers;
use App\Services\UpdateService;
class LocationController extends Controller
{
protected $update;
public function __construct(UpdateService $updateService)
{
$this->update = $updateService;
}
public function updateLocations()
{
$result = $this->update->data();
return back()->with(
'message',
$result
);
}
public function compileLocations()
{
$result = $this->update->list();
return back()->with(
'message',
$result
);
}
}