I have this route defined Route::resource('smn','smnController');
And this controller smnController
which as following code.
public function index()
{
return "hello";
}
In console when I type php artisan routes
, it displays
GET|HEAD smn | smn.index | smnController@index
along with many others.
In the url when I type http://localhost:8081/laravel/smn
, it displays error not found.
But when I change route to Route::resource('/','smnController');
, and url to http://localhost:8081/laravel/
it displays helo
.
Can anyone please explain this
EDIT
complete route and controller
<?php
Route::resource('smn','smnController');
?>
AND COntroller
<?php
class smnController extends BaseController {
public function index()
{
return "hello";
}
}
?>