简体   繁体   中英

Render Google Map in Laravel Voyager admin panel

i am trying to show google map in Voyager admin panel i use bread but i get error :

Invalid argument supplied for foreach() (View: path\vendor\tcg\voyager\resources\views\formfields\coordinates.blade.php) (View: paht\vendor\tcg\voyager\resources\views\formfields\coordinates.blade.php)

any solution ?

You should add trait Spatial in your model

use TCG\\Voyager\\Traits\\Spatial;

and initialize the field with coordinates

use TCG\Voyager\Traits\Spatial;

class Product extends Model
{
  use Spatial;
  protected $spatial = ['coordinates']; //here is going your field name; should be the point type;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM