fzaninotto/Faker

the latitude and longitude field must correspond to the address and the city

dd2424 opened this issue · 2 comments

hello, I have a fixture that works very well but I want the latitude, longitude, postcode, city and address data to match. Example: the latitude and longitude field must correspond to the address and the city. Currently this is not the case! none of the fields match with each other.

            $lat            = $faker->latitude();
            $lng            = $faker->longitude();
            $postalCode     = $faker->postcode();
            $city           = $faker->city();
            $address        = $faker->address();

It's possible ? Do you have a solution ?
thanks

The reason why this is not the case is because the data is fake. The purpose of faker is to create data which can be used to create mock data for any kind of application. A solution for your problem could be to write your own provider which can return an array with information, i.e. :

[
    'lat' => 'xxxxxx',
    'long' => 'yyyyy',
    'postalCode' => 'some postal code',
    'city' => 'some city',
    'address' => 'some address'

]

This would mean that you have to write the implementation yourself and thus have to provide your own list of locations with their corresponding latitude and longitude.

This is the only solution I can think of to fulfill your needs.

ok thanks