php - Laravel custom controller get 404 error -


i have simple custom controller in route :

route::controller(     'validationmobiles', 'validationmobilescontroller',     [         'getindex' => 'validationmobiles.index',     ] ); 

unfortunately 404 error after run url :

http://localhost/laravel/public/validationmobiles.index 

my controller:

namespace app\http\controllers; class validationmobilescontroller extends controller {     public function getindex()     {         dd('ss');     } } 

updated:

full controll, method work fine in laravel 4, in laravel 5 added namespace:

route::controller(     'validationmobiles', 'validationmobilescontroller',     [         'getindex' => 'validationmobiles.index',         'postupdate' => 'validationmobiles.update',         'postedit' => 'validationmobiles.edit',         'getdelete' => 'validationmobiles.delete',         'getaccept' => 'validationmobiles.accept',         'getresend' => 'validationmobiles.resend',     ] ); 

validationmobiles.index name of route you've given, not url. if controller method getindex, method handle request validationmobiles/index url (http://localhost/laravel/public/validationmobiles/index).


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -