Skip to content

Commit

Permalink
Point Coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
rxcod9 committed Sep 3, 2023
1 parent 58875fe commit 0282f6e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::statement("ALTER TABLE `jjwg_areas` MODIFY COLUMN `coordinates` point NULL");
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
DB::statement("ALTER TABLE `jjwg_areas` MODIFY COLUMN `coordinates` VARCHAR(255) NULL");
}
};
18 changes: 11 additions & 7 deletions database/seeders/JjwgArea/DataRowsTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,22 @@ public function run()
])->save();
}

$dataRow = $this->dataRow($dataType, 'coordinates');
$dataRow = $this->dataRow($dataType, 'coordinates'); // point
if (!$dataRow->exists) {
$dataRow->fill([
'type' => 'text',
'display_name' => __('joy-voyager-crm::seeders.data_rows.coordinates'),
'type' => 'coordinates',
'display_name' => __('joy-voyager-bread-sample::seeders.data_rows.coordinates'),
'required' => 0,
'browse' => 0,
'read' => 0,
'edit' => 0,
'add' => 0,
'browse' => 1,
'read' => 1,
'edit' => 1,
'add' => 1,
'delete' => 0,
'order' => ++$order,
'details' => [
"showAutocompleteInput" => true,
"showLatLngInput" => true
]
])->save();
}

Expand Down

0 comments on commit 0282f6e

Please sign in to comment.