Skip to content

Commit

Permalink
Merge pull request #66 from abarreir/master
Browse files Browse the repository at this point in the history
Add Lumen support
  • Loading branch information
rap2hpoutre authored Jun 23, 2016
2 parents bef8c31 + 8aae737 commit 7f34b6c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider::class,
Add a route in `app/Http/routes.php` (or choose another route):
```php
Route::get('logs', '\Rap2hpoutre\LaravelLogViewer\LogViewerController@index');
```
```

For use with Lumen, explicitly set the namespace in `app/Http/routes.php`:
```php
$app->group(['namespace' => '\Rap2hpoutre\LaravelLogViewer'], function() use ($app) {
$app->get('logs', 'LogViewerController@index');
});
```

And add the following in `app/bootstrap.php`:
```php
$app->register(Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider::class);
```

Go to `http://myapp/logs` or some other route
9 changes: 7 additions & 2 deletions src/controllers/LogViewerController.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
<?php
namespace Rap2hpoutre\LaravelLogViewer;

use Illuminate\Routing\Controller;
if (class_exists("\\Illuminate\\Routing\\Controller")) {
class BaseController extends \Illuminate\Routing\Controller {}
} else if (class_exists("Laravel\\Lumen\\Routing\\Controller")) {
class BaseController extends \Laravel\Lumen\Routing\Controller {}
}

use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\View;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\Response;

class LogViewerController extends Controller
class LogViewerController extends BaseController
{

public function index()
Expand Down

0 comments on commit 7f34b6c

Please sign in to comment.