Ich erstelle eine Tabelle wie folgt behandeln:Wie mySql POINT Felder in Laravel
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('places', function (Blueprint $table) {
$table->engine = 'MyISAM';
$table->increments('id');
$table->text('description');
$table->longText('address');
$table->point('coordinates');
$table->timestamps();
});
}
Ich habe ein Feld direkt in meine Datenbank mit:
INSERT INTO `places` (`id`, `description`, `address`, `coordinates`, `created_at`, `updated_at`)
VALUES
(1, 'Plaza Condesa', 'Av. Juan Escutia 4, Hipodromo Condesa, Hipódromo, 06140 Cuauhtémoc, CDMX', X'000000000101000000965B5A0D89693340CC1B711214CB58C0', NULL, NULL);
Dann rufe ich es in Laravel mit :
MyModel::first()
Alle Werte scheinen korrekt mit Ausnahme der coordinates
Feld zu sein, wo ich so etwas wie dieses:
�[Z
�[email protected]�q�X�
Wie kann ich die POINT Feld mit Laravel bekommen?
habe ich nicht. Ich speicherte es direkt in mySQL – awavi
Das ist der Punkt – awavi
Ich habe es als SQL-Anweisung exportiert, aber es ist der Punkt (19.xxx -99.xxx) – awavi