我是Laravel的新手,最近几天,我试图修复此错误。我已经浪费了几个小时,但仍然没有找到解决方法。Controller.php存在于App \ Http \ Controllers中。因此,我无法及时完成项目,截止日期越来越快。
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Html\FormBuilder;
use DB;
use App\Http\Controllers\Controller;
class HomeController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function index()
{
return view('home');
}
public function insertform()
{
return view('home');
}
public function insertMeasurement(Request $request) {
$neck = $request->input('neck');
$arm_length = $request->input('arm_length');
$chest = $request->input('chest');
$stomach = $request->input('stomach');
$seat = $request->input('seat');
$shirt_length = $request->input('shirt_length');
$shoulder = $request->input('shoulder');
$arm = $request->input('arm');
$bicep = $request->input('bicep');
$wrist = $request->input('wrist');
$data=array("neck"=>$neck,"arm_length"=>$arm_length,"chest"=>$chest,"stomach"=>$stomach,"seat"=>$seat,
"shirt_length"=>$shirt_length,"shoulder"=>$shoulder,"arm"=>$arm,"bicep"=>$bicep,"wrist"=>$wrist);
DB::table('measurements')->insert($data);
echo "Record inserted successfully.<br/>";
echo '<a href = "/insert">Click Here</a> to go back.';
}
}
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。