laravel - 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);
});
}
我需要存储餐馆坐标,以便我可以查询用户附近的那些你也可以帮助解决这个问题
解决方案
推荐阅读
- javascript - 在 R Shiny 中向嵌套数据表添加其他按钮
- python - 优化 2 个用 Python 编写的函数
- parsing - Flex:词法分析器删除 Haskell 中的多注释行
- unetstack - 有没有办法为自定义频道提供水深测量?
- c# - 想用 C# 中的 dll 来编译一个基本程序
- single-sign-on - 使用 Pingfederate 作为 SP 和 Okta 作为 IDP
- mysql - SQL将值从一个表复制到另一个
- opengl - Opengl Skybox Depth Buffer 隐藏场景
- python - 优化我的代码 [2d 列表,访问列表的每个第二个元素]
- python - Python3 .replace 产生 TypeError:需要一个类似字节的对象,而不是“str”