duanjue2576 2017-10-24 14:57
浏览 98
已采纳

在Laravel Voyager管理面板中渲染Google Map

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\voyageresources\views\formfields\coordinates.blade.php) (View: paht\vendor\tcg\voyageresources\views\formfields\coordinates.blade.php)

any solution ?

  • 写回答

1条回答 默认 最新

  • doushun1870 2017-11-02 13:31
    关注

    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;
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退