-2

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 ?

Ali Mardini
  • 185
  • 1
  • 16
  • 1
    Please Read [How to Ask a Good Question on Stack Overflow](https://stackoverflow.com/help/how-to-ask) – cmprogram Oct 24 '17 at 15:00

1 Answers1

4

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;
}
Jam
  • 56
  • 4
  • Thanks a lot, I don't know why there is a clear documentation for this awesome Voyager! – Husam Dec 03 '18 at 18:08