-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from stylers-llc/feature/parcel-number
Add columns: country_code, floor ,door, latitude, longitude, parcel_number, description
- Loading branch information
Showing
13 changed files
with
173 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
database/migrations/2020_02_20_110322_add_columns_to_addresses_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class AddColumnsToAddressesTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('addresses', function (Blueprint $table) { | ||
$table->string('country_code', 2)->nullable()->after('country'); | ||
$table->string('floor')->nullable()->after('number_of_house'); | ||
$table->string('door')->nullable()->after('floor'); | ||
$table->float('latitude')->nullable()->after('door'); | ||
$table->float('longitude')->nullable()->after('latitude'); | ||
$table->string('parcel_number')->nullable()->after('longitude'); | ||
$table->string('description')->nullable()->after('parcel_number'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('addresses', function (Blueprint $table) { | ||
$table->dropColumn('country_code'); | ||
$table->dropColumn('floor'); | ||
$table->dropColumn('door'); | ||
$table->dropColumn('latitude'); | ||
$table->dropColumn('longitude'); | ||
$table->dropColumn('parcel_number'); | ||
$table->dropColumn('description'); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,10 @@ | ||
<?php | ||
|
||
|
||
namespace Stylers\Address\Contracts\Models; | ||
|
||
use Illuminate\Database\Eloquent\Relations\MorphTo; | ||
|
||
/** | ||
* Interface AddressInterface | ||
* @package Stylers\Address\Contracts\Models | ||
*/ | ||
interface AddressInterface | ||
{ | ||
/** | ||
* @return MorphTo | ||
*/ | ||
public function addressable(): MorphTo; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
tests/fixtures/database/migrations/migrations/2018_07_09_104935_create_addresses_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class CreateAddressesTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::create('addresses', function (Blueprint $table) { | ||
$table->increments('id'); | ||
$table->morphs('addressable'); | ||
$table->string('country')->nullable(); | ||
$table->string('zip_code')->nullable(); | ||
$table->string('city')->nullable(); | ||
$table->string('name_of_public_place')->nullable(); // example: "Kossuth Lajos" | ||
$table->string('type_of_public_place')->nullable(); // example: "street" <or> "place" | ||
$table->string('number_of_house')->nullable(); // example: "1-3" | ||
$table->string('type')->nullable(); // AddressTypeEnum | ||
$table->timestamps(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::dropIfExists('addresses'); | ||
} | ||
} |
Oops, something went wrong.