Hi! I am new to Laravel. I am trying to write my first application in Laravel.
I faced a problem with Route::resource
My controller is:
<?php
class LanguageController extends BaseController {
function index() {
$langs = Language::all();
return View::make('admin.language.index')->with('langs', $langs);
}
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
//
}
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$lang = Language::find($id);
return View::make('admin.language.edit')->with('lang', $lang);
}
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
//
}
}
And i have created a route rule:
Route::resource('language', 'LanguageController');
but when I visit mycoolapp/admin/language the error appears
Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException
Can someone tell me what is wrong?
Route::resource('admin/language', 'LanguageController');
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community