{"action":"created","issue":{"url":"https://api.github.com/repos/jdorn/php-reports/issues/235","repository_url":"https://api.github.com/repos/jdorn/php-reports","labels_url":"https://api.github.com/repos/jdorn/php-reports/issues/235/labels{/name}","comments_url":"https://api.github.com/repos/jdorn/php-reports/issues/235/comments","events_url":"https://api.github.com/repos/jdorn/php-reports/issues/235/events","html_url":"https://github.com/jdorn/php-reports/issues/235","id":173218852,"number":235,"title":"Integration with Laravel 5.1 Framework","user":{"login":"gbvaz","id":7118638,"avatar_url":"https://avatars.githubusercontent.com/u/7118638?v=3","gravatar_id":"","url":"https://api.github.com/users/gbvaz","html_url":"https://github.com/gbvaz","followers_url":"https://api.github.com/users/gbvaz/followers","following_url":"https://api.github.com/users/gbvaz/following{/other_user}","gists_url":"https://api.github.com/users/gbvaz/gists{/gist_id}","starred_url":"https://api.github.com/users/gbvaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbvaz/subscriptions","organizations_url":"https://api.github.com/users/gbvaz/orgs","repos_url":"https://api.github.com/users/gbvaz/repos","events_url":"https://api.github.com/users/gbvaz/events{/privacy}","received_events_url":"https://api.github.com/users/gbvaz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-25T14:28:58Z","updated_at":"2016-12-16T15:19:55Z","closed_at":null,"body":"Hello! I've been using PHP Reports for some days as an independent install, just to see how it all works, and I think itis right tool for me!\n\nThe only problem is that I'm not so sure how can I integrate it with my system that runs on Laravel (5.1) framework. I've been looking into other issues here on github, and I've found a couple of similar questions, one for Zend framework (Issue #213) and another for CakePHP 3.x (Issue #204). Should that approach work for Laravel too? Did anyone got it working in the first place?\n\nAny help is appreciated! Thanks!\n"},"comment":{"url":"https://api.github.com/repos/jdorn/php-reports/issues/comments/267616724","html_url":"https://github.com/jdorn/php-reports/issues/235#issuecomment-267616724","issue_url":"https://api.github.com/repos/jdorn/php-reports/issues/235","id":267616724,"user":{"login":"lrojas94","id":5957926,"avatar_url":"https://avatars.githubusercontent.com/u/5957926?v=3","gravatar_id":"","url":"https://api.github.com/users/lrojas94","html_url":"https://github.com/lrojas94","followers_url":"https://api.github.com/users/lrojas94/followers","following_url":"https://api.github.com/users/lrojas94/following{/other_user}","gists_url":"https://api.github.com/users/lrojas94/gists{/gist_id}","starred_url":"https://api.github.com/users/lrojas94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrojas94/subscriptions","organizations_url":"https://api.github.com/users/lrojas94/orgs","repos_url":"https://api.github.com/users/lrojas94/repos","events_url":"https://api.github.com/users/lrojas94/events{/privacy}","received_events_url":"https://api.github.com/users/lrojas94/received_events","type":"User","site_admin":false},"created_at":"2016-12-16T15:19:55Z","updated_at":"2016-12-16T15:19:55Z","body":"I just finished integrating it with laravel 5.3 :). it was not extremely hard. In case you're still interested:\r\n\r\n* Create a new controller, I called mine PHPReportsController\r\n* Add requires there:\r\n```php\r\n<?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse Illuminate\\Http\\Request;\r\n\r\nclass PHPReportController extends Controller\r\n{\r\n    public function __construct() {\r\n        require_once(base_path('phpreports/vendor/autoload.php'));\r\n        require_once(base_path('phpreports/lib/PhpReports/PhpReports.php'));\r\n    }\r\n\r\n    public function index() {\r\n        \\PhpReports::listReports();\r\n    }\r\n\r\n    public function reportListJson() {\r\n        return response()\r\n                ->json(\\PhpReports::getReportListJSON());\r\n    }\r\n\r\n    public function report(Request $request) {\r\n        \\PhpReports::displayReport($request->input('report'),'html');\r\n    }\r\n\r\n    public function reportWithFormat(Request $request, $format) {\r\n        \\PhpReports::displayReport($request->input('report'),$format);\r\n    }\r\n}\r\n\r\n```\r\n* Re-Route all routes present in **php-reports/index.php**\r\n* Since PHP Reports uses php5, you should also check the PR #220 to make it work with PHP7 if needed.\r\n* Re-structure paths on PHPReports.php so that they use **base_path()** function. This happens, as explained in #204 because of relative paths. Note that you should do the same in the config file for the paths to all needed folders.\r\n\r\nI got it up and running :) I tried reportico before... but since I wanted control over the code, sadly, I had to let it go... This one seem to have a better code base and is better organized."}}
{"actor":{"display_login":"lrojas94"}}