Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/laravolt/indonesia
Browse files Browse the repository at this point in the history
  • Loading branch information
uyab committed Sep 23, 2019
2 parents 909e847 + e5f9c98 commit 878116d
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Http/Requests/Kabupaten/Store.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public function rules()
'id' => ['required', 'max:4', Rule::unique((new Kabupaten())->getTable())->ignore($this->previous_id, 'id')],
'name' => ['required'],
'province_id' => ['required'],
'meta' => 'nullable',
];
}

Expand Down
1 change: 1 addition & 0 deletions src/Http/Requests/Kecamatan/Store.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public function rules()
'id' => ['required', 'max:8', Rule::unique((new Kecamatan())->getTable())->ignore($this->previous_id, 'id')],
'name' => ['required'],
'city_id' => ['required'],
'meta' => 'nullable',
];
}

Expand Down
1 change: 1 addition & 0 deletions src/Http/Requests/Kelurahan/Store.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public function rules()
'id' => ['required', 'max:10', Rule::unique((new Kelurahan())->getTable())->ignore($this->previous_id, 'id')],
'name' => ['required'],
'district_id' => ['required'],
'meta' => 'nullable',
];
}

Expand Down
1 change: 1 addition & 0 deletions src/Http/Requests/Provinsi/Store.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function rules()
return [
'id' => ['required', 'max:2', Rule::unique((new Provinsi())->getTable())->ignore($this->previous_id, 'id')],
'name' => ['required'],
'meta' => 'nullable',
];
}

Expand Down
4 changes: 4 additions & 0 deletions src/Models/City.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ class City extends Model
{
protected $table = 'cities';

protected $casts = [
'meta' => 'array',
];

public $timestamps = false;

public function province()
Expand Down
4 changes: 4 additions & 0 deletions src/Models/District.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ class District extends Model
{
protected $table = 'districts';

protected $casts = [
'meta' => 'array',
];

public $timestamps = false;

public function city()
Expand Down
4 changes: 4 additions & 0 deletions src/Models/Province.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ class Province extends Model
{
protected $table = 'provinces';

protected $casts = [
'meta' => 'array',
];

public $timestamps = false;

public function cities()
Expand Down
4 changes: 4 additions & 0 deletions src/Models/Village.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ class Village extends Model
{
protected $table = 'villages';

protected $casts = [
'meta' => 'array',
];

public $timestamps = false;

public function district()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public function up()
{
$table->char('id', 2);
$table->string('name', 255);
$table->text('meta')->nullable();
$table->primary('id');
$table->timestamps();
});
Expand Down
1 change: 1 addition & 0 deletions src/migrations/2016_08_03_072750_create_cities_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public function up()
$table->char('id', 4);
$table->char('province_id', 2);
$table->string('name', 255);
$table->text('meta')->nullable();
$table->primary('id');
$table->timestamps();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function up()
$table->char('id', 7);
$table->char('city_id', 4);
$table->string('name', 255);
$table->text('meta')->nullable();
$table->primary('id');
$table->timestamps();

Expand Down
1 change: 1 addition & 0 deletions src/migrations/2016_08_03_072819_create_villages_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function up()
$table->char('id', 10);
$table->char('district_id', 7);
$table->string('name', 255);
$table->text('meta')->nullable();
$table->primary('id');
$table->timestamps();

Expand Down

0 comments on commit 878116d

Please sign in to comment.