我得到控制器不存在错误。
这些是代码。
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use Illuminate\Support\Facades\DB;
class videosController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$videos = DB::table('videos')->get();
return view('index', ['videos' => $videos]);
//return View:make('index');
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
路线
Route::get('/',array('uses' => 'videosController@index'));
答案 0 :(得分:1)
这完美无缺。 路线::得到( '/',[ 'uses'=&gt; 'videosController @指数', 'as'=&gt; '索引'
]);
答案 1 :(得分:1)
相信您的问题与文件名有关。 Linux vs Windows名称区分大小写,请看名称。
看完之后:
php artisan dump-autoload或composer dump-autoload