这是控制器页面。错误说
请求不存在
我无法找到原因。
<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
public function insert( Request $req)
{
$name=$req->input('task_name');
$detail=$req->input('task_detail');
$data=array('task_name'=>$name,'task_detail'=>$detail);
DB::table('tasks')->insert($data);
echo "success";
}
}
答案 0 :(得分:2)
添加命名空间
use App\Http\Requests\Request;