{"action":"created","issue":{"url":"https://api.github.com/repos/sleeping-owl/admin/issues/26","labels_url":"https://api.github.com/repos/sleeping-owl/admin/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/sleeping-owl/admin/issues/26/comments","events_url":"https://api.github.com/repos/sleeping-owl/admin/issues/26/events","html_url":"https://github.com/sleeping-owl/admin/issues/26","id":56159931,"number":26,"title":"Routing in custom controllers","user":{"login":"vkosachev","id":6143450,"avatar_url":"https://avatars.githubusercontent.com/u/6143450?v=3","gravatar_id":"","url":"https://api.github.com/users/vkosachev","html_url":"https://github.com/vkosachev","followers_url":"https://api.github.com/users/vkosachev/followers","following_url":"https://api.github.com/users/vkosachev/following{/other_user}","gists_url":"https://api.github.com/users/vkosachev/gists{/gist_id}","starred_url":"https://api.github.com/users/vkosachev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkosachev/subscriptions","organizations_url":"https://api.github.com/users/vkosachev/orgs","repos_url":"https://api.github.com/users/vkosachev/repos","events_url":"https://api.github.com/users/vkosachev/events{/privacy}","received_events_url":"https://api.github.com/users/vkosachev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-01T10:54:35Z","updated_at":"2015-02-01T16:27:01Z","closed_at":null,"body":"Hi, I've wanted to use a custom controller in the admin panel. It seems that I can only route to the  action specified in  menu configuration. If I create an url to my controller from the view, I cannot get to the action.\r\n\r\nFor example :\r\n```PHP\r\nAdmin::menu()->url('claims')->label('Claims')->icon('fa-money')->uses('\\Controllers\\Dashboard\\ClaimController@getIndex');\r\n```\r\n\r\nThen, in my action I render a view. From that view I try to provide a link to another method in that controller:\r\n\r\n```PHP\r\n<a class=\"btn btn-success btn-sm\" href=\"{{action('\\Controllers\\Dashboard\\ClaimController@getInfo', $claim->id)}}\">\r\n```\r\nFirst it said that it cannot find the route, so i thought that adding a specific route to my **routes.php** would do the trick, but it sill ignores that : \r\n```PHP\r\nRoute::group(['prefix' => 'admin', 'before' => 'admin.auth'], function ()\r\n\t{\r\n\t\tRoute::controller('claims', '\\\\Controllers\\\\Dashboard\\\\ClaimController');\r\n\t});\r\n```\r\n\r\nThe main question is how to use the routing inside the custom controller. Thx"},"comment":{"url":"https://api.github.com/repos/sleeping-owl/admin/issues/comments/72371425","html_url":"https://github.com/sleeping-owl/admin/issues/26#issuecomment-72371425","issue_url":"https://api.github.com/repos/sleeping-owl/admin/issues/26","id":72371425,"user":{"login":"sleeping-owl","id":9197310,"avatar_url":"https://avatars.githubusercontent.com/u/9197310?v=3","gravatar_id":"","url":"https://api.github.com/users/sleeping-owl","html_url":"https://github.com/sleeping-owl","followers_url":"https://api.github.com/users/sleeping-owl/followers","following_url":"https://api.github.com/users/sleeping-owl/following{/other_user}","gists_url":"https://api.github.com/users/sleeping-owl/gists{/gist_id}","starred_url":"https://api.github.com/users/sleeping-owl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sleeping-owl/subscriptions","organizations_url":"https://api.github.com/users/sleeping-owl/orgs","repos_url":"https://api.github.com/users/sleeping-owl/repos","events_url":"https://api.github.com/users/sleeping-owl/events{/privacy}","received_events_url":"https://api.github.com/users/sleeping-owl/received_events","type":"User","site_admin":false},"created_at":"2015-02-01T16:27:01Z","updated_at":"2015-02-01T16:27:01Z","body":"Now you can use the following style (update to the latest version):\r\n\r\nCreate hidden menu item for your controller action (this will register necessary route without menu item):\r\n```php\r\nAdmin::menu()->url('subdir/demo')->uses('AdminController@getThird')->hidden();\r\n```\r\n\r\nUse this code to get full url:\r\n```php\r\nroute('sleeping-owl-admin.wildcard', 'subdir/demo')\r\n```\r\n\r\nThis will require menu item for every action you want to use.\r\nIs this enough to solve your problem?"}}