@@ -13,11 +13,11 @@ |
||
13 | 13 | */ |
14 | 14 | public function run() |
15 | 15 | { |
16 | - $body = file_get_contents('https://api.vk.com/method/database.getCountries?v=5.5&need_all=1&count=1000&lang='. |
|
17 | - config('geography.locale') . '&code=' . config('geography.country') . '&access_token=' . |
|
18 | - config('geography.access_token')); |
|
19 | - $response = json_decode($body, true); |
|
16 | + $body = file_get_contents('https://api.vk.com/method/database.getCountries?v=5.5&need_all=1&count=1000&lang='. |
|
17 | + config('geography.locale') . '&code=' . config('geography.country') . '&access_token=' . |
|
18 | + config('geography.access_token')); |
|
19 | + $response = json_decode($body, true); |
|
20 | 20 | |
21 | - Capsule::table( config('geography.nameTable.country') )->insert( $response['response']['items'] ); |
|
21 | + Capsule::table( config('geography.nameTable.country') )->insert( $response['response']['items'] ); |
|
22 | 22 | } |
23 | 23 | } |
@@ -13,11 +13,11 @@ |
||
13 | 13 | */ |
14 | 14 | public function run() |
15 | 15 | { |
16 | - $body = file_get_contents('https://api.vk.com/method/database.getCountries?v=5.5&need_all=1&count=1000&lang='. |
|
17 | - config('geography.locale') . '&code=' . config('geography.country') . '&access_token=' . |
|
16 | + $body = file_get_contents('https://api.vk.com/method/database.getCountries?v=5.5&need_all=1&count=1000&lang=' . |
|
17 | + config('geography.locale') . '&code=' . config('geography.country') . '&access_token=' . |
|
18 | 18 | config('geography.access_token')); |
19 | - $response = json_decode($body, true); |
|
19 | + $response = json_decode($body, true); |
|
20 | 20 | |
21 | - Capsule::table( config('geography.nameTable.country') )->insert( $response['response']['items'] ); |
|
21 | + Capsule::table(config('geography.nameTable.country'))->insert($response['response']['items']); |
|
22 | 22 | } |
23 | 23 | } |
@@ -15,7 +15,7 @@ |
||
15 | 15 | { |
16 | 16 | $response = []; |
17 | 17 | |
18 | - Capsule::table( config('geography.nameTable.country') )->get()->each(function ($item) use ( &$response ) |
|
18 | + Capsule::table(config('geography.nameTable.country'))->get()->each(function($item) use (&$response) |
|
19 | 19 | { |
20 | 20 | $body = file_get_contents('https://api.vk.com/method/database.getRegions?v=5.5&count=1000&country_id=' . $item->id . |
21 | 21 | '&access_token=' . config('geography.access_token')); |
@@ -1,26 +1,26 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return [ |
4 | - // Your native language |
|
5 | - // 0 — Russian, |
|
6 | - // 1 — Ukrainian, |
|
7 | - // 2 — Belarusian, |
|
8 | - // 3 — English, |
|
9 | - // 4 — Spanish, |
|
10 | - // 5 — Finnish, |
|
11 | - // 6 — German, |
|
12 | - // 7 — Italian. |
|
13 | - 'locale' => 0, |
|
4 | + // Your native language |
|
5 | + // 0 — Russian, |
|
6 | + // 1 — Ukrainian, |
|
7 | + // 2 — Belarusian, |
|
8 | + // 3 — English, |
|
9 | + // 4 — Spanish, |
|
10 | + // 5 — Finnish, |
|
11 | + // 6 — German, |
|
12 | + // 7 — Italian. |
|
13 | + 'locale' => 0, |
|
14 | 14 | |
15 | - // Country you wish to migrate |
|
16 | - // standard 3166-1 alpha-2 |
|
17 | - // example RU,AU |
|
15 | + // Country you wish to migrate |
|
16 | + // standard 3166-1 alpha-2 |
|
17 | + // example RU,AU |
|
18 | 18 | 'country' => 'RU', |
19 | 19 | |
20 | - 'nameTable' => [ |
|
21 | - 'country' => 'country', |
|
22 | - 'regions' => 'regions', |
|
23 | - 'cities' => 'cities' |
|
24 | - ], |
|
20 | + 'nameTable' => [ |
|
21 | + 'country' => 'country', |
|
22 | + 'regions' => 'regions', |
|
23 | + 'cities' => 'cities' |
|
24 | + ], |
|
25 | 25 | 'access_token' => '' |
26 | 26 | ]; |