首页 > 解决方案 > laravel形式的坐标输入类型collective

问题描述

我有一个存储餐厅信息的表格

        {!! Form::open(['action' => 'RestaurantsController@store','method'=>'POST','enctype'=>'multipart/form-data'])!!}
        <div class="form-group">
        {{Form::label('name','Name')}}
        {{Form::text('name','',['class'=>'form-control','placeholder'=>'Insert here'])}}
        </div>
        <div class="form-group">
                {{Form::label('hours','Hours')}}
                {{Form::text('hours','',['class'=>'form-control','placeholder'=>'Insert here'])}}
                </div>
                <div class="form-group">
                        {{Form::label('contact','Contact')}}
                        {{Form::text('contact','',['class'=>'form-control','placeholder'=>'Insert here'])}}
                        </div>
                <div class="form-group">
                        {{Form::label('payment','Payment')}}
                        {{Form::text('payment','',['class'=>'form-control','placeholder'=>'Insert here'])}}
                        </div>

        <div class="form-group">
                {{Form::label('menu','Menu')}}
                {{Form::textarea('menu',null,['id'=>'menu','placeholder'=>'Insert here','name'=>'menu'])}}
        </div>
        <div class="form-group">
                        {{Form::label('description','Description')}}
                        {{Form::textarea('description',null,['id'=>'description','placeholder'=>'Insert here','name'=>'description'])}}
                </div>

        <div class="form-group">
                        {{Form::file('cover_image')}}
        </div>
        {{-- {{Form::hidden('_method','POST')}} --}}
        {{Form::submit('submit',['class'=>'btn btn-primary','type'=>'submit','id'=>'submit'])}}

        {!! Form::close() !!} 


        </div>

        </body>


        </html>

        @endsection

我需要存储餐厅的经度和纬度我该怎么做。这是我在创建餐厅表格后添加的纬度迁移

 public function up()
    {
        Schema::table('restaurants', function (Blueprint $table) {
            $table->decimal('lat', 10, 7); 
        });
    }

我需要存储餐馆坐标,以便我可以查询用户附近的那些你也可以帮助解决这个问题

标签: laravelmapslaravel-form

解决方案


推荐阅读