开发者社区> 问答> 正文

找不到Laravel类'App \ Http \ Controllers \ Controller'

我是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.';
}
}

展开
收起
几许相思几点泪 2019-12-08 21:45:46 1149 0
0 条回答
写回答
取消 提交回答
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载