<?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 ); } }