I have begun tinkering with validators in Laravel and seem to have programmed myself into a corner.
Background
I have a method which I use to check if an address exists through Google Maps. Since I started having just one file and validation in that file I just let it return an object containing if longitude and latitude matched and the formated address.
return (object) ['result' => (bool) $match, 'formatedAddress' => (string) $googleMaps->formatted_address];
(Typecast for clarity, no actual typecast in code at this point.)
This worked well in the controller since I could reuse the variables within the method, but not so well after moving it to AppServiceProvider.
Question:
Is there a way to make Validator::extend() set a public parameter upon validation so I can reach the formatted address? Or do I have to go about doing this in another way?
Using PHP 5.6 and Laravel 5.4.