【发布时间】:2019-05-13 02:53:18
【问题描述】:
我有一个用于发布请求的路由,在控制器中我想知道我在发布请求中发送了哪些值,我是 Laravel 的新手。我该怎么做?
这是我的模型的代码:
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class OMeta extends Model
{
protected $fillable= ['n_bandera','h_entrada','h_salida','locacion','fecha','ticket','so'];
}
我想从 post 请求中获取 'n_bandera' 属性。我怎么能在以下控制器功能中做到这一点:
public function store(Request $request){
// get the 'n_bandera' attribute from the $request
}
另外,我不想使用all() 之类的方法,因为我希望请求中的内容转到数据库中的不同表。
【问题讨论】:
标签: php laravel rest post request