내가 같은 테이블을 만드는 오전에 MySQL의 POINT 필드를 처리하는 방법 : 는 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();
});
}
내가 사용하여 내 데이터베이스에 직접 필드를 생성 :
다음
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);
내가 사용 Laravel에서 검색 :
MyModel::first()
모든 값은 내가 얻을 coordinates
필드를 제외하고 제대로 것 같다 다음과 같이 입력하십시오 :
�[Z
�[email protected]�q�X�
어떻게 Lolavel을 사용하여 POINT 필드를 얻을 수 있습니까?
나는 그렇지 않았다. – awavi
포인트가 – awavi
입니다. SQL 문으로 내보냈지만 POINT (19.xxx -99.xxx) – awavi