2023-08-14 22:33:53 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
2024-02-15 22:00:03 +01:00
|
|
|
use App\Services\UpdateService;
|
2023-08-14 22:33:53 +02:00
|
|
|
|
|
|
|
class LocationController extends Controller
|
|
|
|
{
|
2024-02-15 22:00:03 +01:00
|
|
|
protected $update;
|
2023-08-25 00:27:14 +02:00
|
|
|
|
2024-02-15 22:00:03 +01:00
|
|
|
public function __construct(UpdateService $updateService)
|
2023-08-25 00:27:14 +02:00
|
|
|
{
|
2024-02-15 22:00:03 +01:00
|
|
|
$this->update = $updateService;
|
2024-02-12 21:51:28 +01:00
|
|
|
}
|
|
|
|
|
2024-02-15 22:00:03 +01:00
|
|
|
public function updateLocations()
|
2024-02-12 21:51:28 +01:00
|
|
|
{
|
2024-02-15 22:00:03 +01:00
|
|
|
$result = $this->update->locations();
|
|
|
|
|
|
|
|
return back()->with(
|
|
|
|
'message',
|
|
|
|
$result['duplicates'] .
|
|
|
|
' UPDATED - ' . $result['fresh'] .
|
|
|
|
' CREATED - ' . count($result['missing']) .
|
|
|
|
' SOURCE(S) NOT CHECKED'
|
|
|
|
);
|
2023-08-25 00:27:14 +02:00
|
|
|
}
|
2023-08-14 22:33:53 +02:00
|
|
|
}
|