Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TM-1422] update world countries #540

Merged
merged 4 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/Models/V2/WorldCountryGeneralized.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
namespace App\Models\V2;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

/**
* @method static forIso($countryIso): Builder
*/
class WorldCountryGeneralized extends Model
{
use HasFactory;

public $timestamps = false;

protected $table = 'world_countries_generalized';

protected $fillable = [
Expand Down
35 changes: 35 additions & 0 deletions database/factories/V2/WorldCountryGeneralizedFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace Database\Factories\V2;

use App\Models\V2\WorldCountryGeneralized;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\DB;

/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\WorldCountryGeneralized>
*/
class WorldCountryGeneralizedFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
protected $model = WorldCountryGeneralized::class;

public function definition()
{

$geometryAustralia = file_get_contents('database/seeders/Data/australia.geojson');

return [
'countryaff' => 'Australia',
'country' => 'Australia',
'iso' => 'AU',
'aff_iso' => 'AU',
'OGR_FID' => 264,
'geometry' => DB::raw("ST_GeomFromGeoJSON('$geometryAustralia')"),
];
}
}
1 change: 1 addition & 0 deletions database/seeders/Data/australia.geojson

Large diffs are not rendered by default.

Loading
Loading