structure and style updates
This commit is contained in:
+4
-3
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::view('/', 'welcome')->name('home');
|
||||
@@ -14,7 +15,7 @@ require __DIR__.'/settings.php';
|
||||
Route::get('/api/countries/resolve/{code}', function (string $code) {
|
||||
$normalised = strtoupper(trim($code));
|
||||
|
||||
$country = \Illuminate\Support\Facades\DB::table('countries')
|
||||
$country = DB::table('countries')
|
||||
->whereRaw('UPPER(alpha2) = ?', [$normalised])
|
||||
->orWhereRaw('UPPER(alpha3) = ?', [$normalised])
|
||||
->orWhere('numeric', $normalised)
|
||||
@@ -43,7 +44,7 @@ Route::get('/api/countries/resolve/{code}', function (string $code) {
|
||||
Route::get('/api/countries/{code}/subdivisions', function (string $code) {
|
||||
$normalised = strtoupper(trim($code));
|
||||
|
||||
$country = \Illuminate\Support\Facades\DB::table('countries')
|
||||
$country = DB::table('countries')
|
||||
->whereRaw('UPPER(alpha2) = ?', [$normalised])
|
||||
->orWhereRaw('UPPER(alpha3) = ?', [$normalised])
|
||||
->orWhere('numeric', $normalised)
|
||||
@@ -51,7 +52,7 @@ Route::get('/api/countries/{code}/subdivisions', function (string $code) {
|
||||
|
||||
abort_if($country === null, 404);
|
||||
|
||||
$subdivisions = \Illuminate\Support\Facades\DB::table('country_subdivisions')
|
||||
$subdivisions = DB::table('country_subdivisions')
|
||||
->where('country_id', $country->id)
|
||||
->orderBy('sort_order')
|
||||
->orderBy('name')
|
||||
|
||||
Reference in New Issue
Block a user