diff --git a/src/Illuminate/Database/Schema/Blueprint.php b/src/Illuminate/Database/Schema/Blueprint.php index a61c9b8185b0..cfc461057e3d 100755 --- a/src/Illuminate/Database/Schema/Blueprint.php +++ b/src/Illuminate/Database/Schema/Blueprint.php @@ -1061,12 +1061,13 @@ public function geometry($column) /** * Create a new point column on the table. * - * @param string $column + * @param string $column + * @param null|int $srid * @return \Illuminate\Support\Fluent */ - public function point($column) + public function point($column, $srid = null) { - return $this->addColumn('point', $column); + return $this->addColumn('point', $column, compact('srid')); } /** diff --git a/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php b/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php index 14576e0e9aad..0b48336da334 100755 --- a/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php +++ b/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php @@ -15,7 +15,7 @@ class MySqlGrammar extends Grammar */ protected $modifiers = [ 'Unsigned', 'VirtualAs', 'StoredAs', 'Charset', 'Collate', 'Nullable', - 'Default', 'Increment', 'Comment', 'After', 'First', + 'Default', 'Increment', 'Comment', 'After', 'First', 'Srid', ]; /** @@ -966,6 +966,20 @@ protected function modifyComment(Blueprint $blueprint, Fluent $column) } } + /** + * Get the SQL for a SRID column modifier. + * + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $column + * @return string|null + */ + protected function modifySrid(Blueprint $blueprint, Fluent $column) + { + if (! is_null($column->srid) && is_int($column->srid) && $column->srid > 0) { + return ' srid '. $column->srid; + } + } + /** * Wrap a single string in keyword identifiers. *