Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rap2hpoutre/laravel-log-viewer
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.22.0
Choose a base ref
...
head repository: rap2hpoutre/laravel-log-viewer
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
91 changes: 91 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Tests

on:
push:
pull_request:

jobs:
tests:
strategy:
fail-fast: true
matrix:
php: ["7.2", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]
laravel: ["^6.0", "^7.0", "^8.0", "^9.0", "^10.0", "^11.0", "^12.0"]
exclude:
- php: "8.0"
laravel: "^10.0"
- php: "7.4"
laravel: "^10.0"
- php: "7.2"
laravel: "^10.0"
- php: "7.4"
laravel: "^9.0"
- php: "7.2"
laravel: "^9.0"
- php: "8.4"
laravel: "^8.0"
- php: "8.3"
laravel: "^8.0"
- php: "8.2"
laravel: "^8.0"
- php: "7.2"
laravel: "^8.0"
- php: "8.4"
laravel: "^7.0"
- php: "8.3"
laravel: "^7.0"
- php: "8.2"
laravel: "^7.0"
- php: "8.1"
laravel: "^7.0"
- php: "8.4"
laravel: "^6.0"
- php: "8.3"
laravel: "^6.0"
- php: "8.2"
laravel: "^6.0"
- php: "8.1"
laravel: "^6.0"
- php: "7.2"
laravel: "^11.0"
- php: "7.4"
laravel: "^11.0"
- php: "8.0"
laravel: "^11.0"
- php: "8.1"
laravel: "^11.0"
- php: "7.2"
laravel: "^12.0"
- php: "7.4"
laravel: "^12.0"
- php: "8.0"
laravel: "^12.0"
- php: "8.1"
laravel: "^12.0"
name: "PHP${{ matrix.php }} - Laravel${{ matrix.laravel }}"

runs-on: "ubuntu-latest"

steps:
- name: "Checkout code"
uses: "actions/checkout@v3"

- name: "Setup PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php }}"
extensions: "dom, curl, libxml, mbstring, zip, fileinfo"
tools: "composer:v2"
coverage: "none"

- name: "Check Composer configuration"
run: "composer validate --strict"

- name: "Install dependencies from composer.json"
run: "composer update --with='laravel/framework:${{ matrix.laravel }}' --no-interaction --no-progress"

- name: "Check PSR-4 mapping"
run: "composer dump-autoload --optimize --strict-psr"

- name: "Execute unit tests"
run: "vendor/bin/phpunit"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/vendor
composer.lock
/.idea
/build
/build
.phpunit.result.cache
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014-2018 rap2hpoutre
Copyright (c) 2014-present rap2hpoutre

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
59 changes: 30 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
Laravel 5 log viewer
======================
Laravel log viewer
==================

[![Packagist](https://img.shields.io/packagist/v/rap2hpoutre/laravel-log-viewer.svg)](https://packagist.org/packages/rap2hpoutre/laravel-log-viewer)
[![Packagist](https://img.shields.io/packagist/l/rap2hpoutre/laravel-log-viewer.svg)](https://packagist.org/packages/rap2hpoutre/laravel-log-viewer)
[![Packagist](https://img.shields.io/packagist/dm/rap2hpoutre/laravel-log-viewer.svg)](https://packagist.org/packages/rap2hpoutre/laravel-log-viewer)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/rap2hpoutre/laravel-log-viewer/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/rap2hpoutre/laravel-log-viewer/?branch=master)
[![Build Status](https://scrutinizer-ci.com/g/rap2hpoutre/laravel-log-viewer/badges/build.png?b=master)](https://scrutinizer-ci.com/g/rap2hpoutre/laravel-log-viewer/build-status/master)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/7be7a05b07c94f319ec35f95a4d64074)](https://www.codacy.com/app/rap2hpoutre/laravel-log-viewer)
[![Author](https://img.shields.io/badge/author-@rap2h-blue.svg)](https://twitter.com/rap2h)


TL;DR
-----
Log Viewer for Laravel 5 (compatible with 4.2 too) and Lumen. **Install with composer, create a route to `LogViewerController`**. No public assets, no vendor routes, works with and/or without log rotate. Inspired by Micheal Mand's [Laravel 4 log viewer](https://github.com/mikemand/logviewer) (works only with laravel 4.1)
## TL;DR
Log Viewer for Laravel 6, 7, 8, 9, 10, 11 & 12 and Lumen. **Install with composer, create a route to `LogViewerController`**. No public assets, no vendor routes, works with and/or without log rotate. Inspired by Micheal Mand's [Laravel 4 log viewer](https://github.com/mikemand/logviewer) (works only with laravel 4.1)

What ?
------
## What ?
Small log viewer for laravel. Looks like this:

![capture d ecran 2014-12-01 a 10 37 18](https://cloud.githubusercontent.com/assets/1575946/5243642/8a00b83a-7946-11e4-8bad-5c705f328bcc.png)

Install (Laravel)
-----------------
## Install (Laravel)
Install via composer
```
```bash
composer require rap2hpoutre/laravel-log-viewer
```

@@ -34,24 +29,14 @@ Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider::class,

Add a route in your web routes file:
```php
Route::get('logs', '\Rap2hpoutre\LaravelLogViewer\LogViewerController@index');
Route::get('logs', [\Rap2hpoutre\LaravelLogViewer\LogViewerController::class, 'index']);
```

Go to `http://myapp/logs` or some other route

**Optionally** publish `log.blade.php` into `/resources/views/vendor/laravel-log-viewer/` for view customization:

```
php artisan vendor:publish \
--provider="Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider" \
--tag=views
```

Install (Lumen)
---------------

### Install (Lumen)
Install via composer
```
```bash
composer require rap2hpoutre/laravel-log-viewer
```

@@ -62,13 +47,29 @@ $app->register(\Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider::cl

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

Troubleshooting
---------------
## Advanced usage
### Customize view
Publish `log.blade.php` into `/resources/views/vendor/laravel-log-viewer/` for view customization:

```bash
php artisan vendor:publish \
--provider="Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider" \
--tag=views
```

### Edit configuration
Publish `logviewer.php` configuration file into `/config/` for configuration customization:

```bash
php artisan vendor:publish \
--provider="Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider"
```

### Troubleshooting
If you got a `InvalidArgumentException in FileViewFinder.php` error, it may be a problem with config caching. Double check installation, then run `php artisan config:clear`.

19 changes: 13 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -2,7 +2,14 @@
"name": "rap2hpoutre/laravel-log-viewer",
"description": "A Laravel log reader",
"license": "MIT",
"keywords": ["log", "log-reader", "log-viewer", "logging", "laravel", "lumen"],
"keywords": [
"log",
"log-reader",
"log-viewer",
"logging",
"laravel",
"lumen"
],
"type": "laravel-package",
"authors": [
{
@@ -11,12 +18,12 @@
}
],
"require": {
"php": ">=5.4.0",
"illuminate/support": "4.2.*|5.*"
"php": "^7.2|^8.0",
"illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0"
},
"require-dev": {
"phpunit/phpunit": "^7",
"orchestra/testbench": "^3.6"
"phpunit/phpunit": "^7||^8.4|^9.3.3|^10.1|^11.0",
"orchestra/testbench": "^4.0|^5.0|^6.0|^7.0|^8.0|^9.0|^10.0"
},
"autoload": {
"classmap": [
@@ -28,7 +35,7 @@
},
"autoload-dev": {
"psr-4": {
"Rap2hpoutre\\LaravelLogViewer\\Test\\": "tests/"
"Rap2hpoutre\\LaravelLogViewer\\Tests\\": "tests/"
}
},
"extra": {
14 changes: 1 addition & 13 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true" bootstrap="./vendor/autoload.php" convertNoticesToExceptions="true" convertWarningsToExceptions="true" stopOnError="false" stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false">
<phpunit colors="true" bootstrap="./vendor/autoload.php">
<testsuites>
<testsuite name="all">
<directory suffix="Test.php">tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<logging>
<log type="tap" target="build/report.tap"/>
<log type="junit" target="build/report.junit.xml"/>
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
<log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
</phpunit>
Loading