我有一个laravel表格。 如果提交有关用户的大量信息,然后将其提交给store()函数。
public function store()
{
$input = Input::except('_token');
if ( ! $this->validator->with($input)->passes())
{
return Redirect::back()->withErrors($this->validator->errors())->withInput($input);
}
$this->title->save($input);
return Redirect::back()->withSuccess( trans('main.created successfully') );
}
public function save()
{
if ($this->query && $this->values)
{
return DB::statement($this->query, array_values($this->values));
}
}
查询在save()
函数
然后,用户可以访问www.mysite/{$id}
执行查询并将其保存到我的数据库中时会生成{$id}
变量。它是我的数据库中id
列的值。
我希望在用户提交表单时发送电子邮件,说明信息已成功输入,并且他们可以在www.mysite/{$id}
查看,但我不知道应该将哪个变量放入mailer()
1}}函数表示{$id}
,因为该变量在保存时生成。如何实现将{$id}
变量传递给mailer()
函数的方法?