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