Skip to content

Commit

Permalink
Merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
tvup committed Jul 26, 2024
2 parents feaa6a3 + 070adc8 commit e923632
Show file tree
Hide file tree
Showing 21 changed files with 283 additions and 166 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.1]
laravel: [9.*]
php: [8.2]
laravel: [10.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 9.*
testbench: ^7.0
- laravel: 10.*
testbench: 8.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

Expand Down
2 changes: 1 addition & 1 deletion .php-cs-fixer.cache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"php":"8.2.3","version":"3.15.1","indent":" ","lineEnding":"\n","rules":{"array_syntax":{"syntax":"short"},"blank_line_after_namespace":true,"blank_line_after_opening_tag":true,"braces":true,"cast_spaces":true,"concat_space":{"spacing":"one"},"declare_equal_normalize":true,"elseif":true,"encoding":true,"full_opening_tag":true,"fully_qualified_strict_types":true,"function_declaration":true,"function_typehint_space":true,"heredoc_to_nowdoc":true,"include":true,"increment_style":{"style":"post"},"indentation_type":true,"linebreak_after_opening_tag":true,"line_ending":true,"lowercase_cast":true,"lowercase_keywords":true,"lowercase_static_reference":true,"magic_method_casing":true,"magic_constant_casing":true,"method_argument_space":true,"native_function_casing":true,"no_extra_blank_lines":{"tokens":["extra","throw","use","use_trait"]},"no_blank_lines_after_class_opening":true,"no_blank_lines_after_phpdoc":true,"no_closing_tag":true,"no_empty_phpdoc":true,"no_empty_statement":true,"no_leading_import_slash":true,"no_leading_namespace_whitespace":true,"no_mixed_echo_print":{"use":"echo"},"no_multiline_whitespace_around_double_arrow":true,"multiline_whitespace_before_semicolons":{"strategy":"no_multi_line"},"no_short_bool_cast":true,"no_singleline_whitespace_before_semicolons":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_comma_in_list_call":true,"no_trailing_comma_in_singleline_array":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"no_useless_return":true,"no_whitespace_before_comma_in_array":true,"no_whitespace_in_blank_line":true,"normalize_index_brace":true,"object_operator_without_whitespace":true,"phpdoc_indent":true,"phpdoc_no_access":true,"phpdoc_no_package":true,"phpdoc_no_useless_inheritdoc":true,"phpdoc_scalar":true,"phpdoc_single_line_var_spacing":true,"phpdoc_summary":true,"phpdoc_to_comment":true,"phpdoc_trim":true,"phpdoc_types":true,"phpdoc_var_without_name":true,"short_scalar_cast":true,"single_blank_line_at_eof":true,"single_blank_line_before_namespace":true,"single_import_per_statement":true,"single_line_after_imports":true,"single_line_comment_style":{"comment_types":["hash"]},"single_quote":true,"space_after_semicolon":true,"standardize_not_equals":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"ternary_operator_spaces":true,"trim_array_spaces":true,"unary_operator_spaces":true,"whitespace_after_comma_in_array":true,"constant_case":{"case":"lower"},"general_phpdoc_tag_rename":true,"phpdoc_inline_tag_normalizer":true,"phpdoc_tag_type":true,"trailing_comma_in_multiline":{"elements":["arrays"]},"binary_operator_spaces":{"default":"single_space","operators":{"=>":null}},"blank_line_before_statement":{"statements":["return"]},"class_attributes_separation":{"elements":{"const":"one","method":"one","property":"one"}},"class_definition":{"multi_line_extends_each_single_line":true,"single_item_single_line":true,"single_line":true},"ordered_imports":{"sort_algorithm":"alpha"},"no_unneeded_control_parentheses":{"statements":["break","clone","continue","echo_print","return","switch_case","yield"]},"no_spaces_around_offset":{"positions":["inside","outside"]},"visibility_required":{"elements":["property","method","const"]},"no_unused_imports":true},"hashes":{"src\/Http\/Requests\/IncidentStoreRequest.php":"4d13c1384e8d07bbe7878d3ec641e1d4","src\/Http\/Requests\/ApiRequest.php":"7e5c417b68cecb46aed8b1e6b9a99404","src\/Http\/Controllers\/IncidentController.php":"80170f0e7dd9208d2b6b4a733e228c50","src\/Http\/Controllers\/Api\/IncidentController.php":"64a482b57f22dc2fd60c15eb3144e739","src\/Incident.php":"a417c70d4f76b8eb02ef140c7a4266de","src\/View\/Components\/Ago.php":"2f865fa9a2df4991253cd9ebb327a261","src\/Facades\/LaravelFejlvarp.php":"c79bb7365c831eb5cab20675593432d6","src\/Commands\/LaravelFejlvarpCommand.php":"61ee14a6a451f3fcdafc35e1370ba789","src\/LaravelFejlvarp.php":"bc4c671834d59581b772f524cb896bb0","src\/Exceptions\/Handler.php":"745448807a27389d365e156d52b43dbe","src\/LaravelFejlvarpServiceProvider.php":"9224dbec598f86826032c5cebff82ad7","tests\/TestCase.php":"858f3585ee2e14df08dc659956ef13bc","tests\/ExampleTest.php":"3991be89aec886561a4e2d089f261a2a","tests\/Pest.php":"015a8f313bac5fe4743f5a6d3026ba96"}}
{"php":"8.3.8","version":"3.59.3","indent":" ","lineEnding":"\n","rules":{"array_syntax":{"syntax":"short"},"blank_line_after_namespace":true,"blank_line_after_opening_tag":true,"braces":true,"cast_spaces":true,"concat_space":{"spacing":"one"},"declare_equal_normalize":true,"elseif":true,"encoding":true,"full_opening_tag":true,"fully_qualified_strict_types":true,"function_declaration":true,"function_typehint_space":true,"heredoc_to_nowdoc":true,"include":true,"increment_style":{"style":"post"},"indentation_type":true,"linebreak_after_opening_tag":true,"line_ending":true,"lowercase_cast":true,"lowercase_keywords":true,"lowercase_static_reference":true,"magic_method_casing":true,"magic_constant_casing":true,"method_argument_space":true,"native_function_casing":true,"no_extra_blank_lines":{"tokens":["extra","throw","use","use_trait"]},"no_blank_lines_after_class_opening":true,"no_blank_lines_after_phpdoc":true,"no_closing_tag":true,"no_empty_phpdoc":true,"no_empty_statement":true,"no_leading_import_slash":true,"no_leading_namespace_whitespace":true,"no_mixed_echo_print":{"use":"echo"},"no_multiline_whitespace_around_double_arrow":true,"multiline_whitespace_before_semicolons":{"strategy":"no_multi_line"},"no_short_bool_cast":true,"no_singleline_whitespace_before_semicolons":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_comma_in_list_call":true,"no_trailing_comma_in_singleline_array":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"no_useless_return":true,"no_whitespace_before_comma_in_array":true,"no_whitespace_in_blank_line":true,"normalize_index_brace":true,"object_operator_without_whitespace":true,"phpdoc_indent":true,"phpdoc_no_access":true,"phpdoc_no_package":true,"phpdoc_no_useless_inheritdoc":true,"phpdoc_scalar":true,"phpdoc_single_line_var_spacing":true,"phpdoc_summary":true,"phpdoc_to_comment":true,"phpdoc_trim":true,"phpdoc_types":true,"phpdoc_var_without_name":true,"short_scalar_cast":true,"single_blank_line_at_eof":true,"single_blank_line_before_namespace":true,"single_import_per_statement":true,"single_line_after_imports":true,"single_line_comment_style":{"comment_types":["hash"]},"single_quote":true,"space_after_semicolon":true,"standardize_not_equals":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"ternary_operator_spaces":true,"trim_array_spaces":true,"unary_operator_spaces":true,"whitespace_after_comma_in_array":true,"constant_case":{"case":"lower"},"general_phpdoc_tag_rename":true,"phpdoc_inline_tag_normalizer":true,"phpdoc_tag_type":true,"trailing_comma_in_multiline":{"elements":["arrays"]},"binary_operator_spaces":{"default":"single_space","operators":{"=>":null}},"blank_line_before_statement":{"statements":["return"]},"class_attributes_separation":{"elements":{"const":"one","method":"one","property":"one"}},"class_definition":{"multi_line_extends_each_single_line":true,"single_item_single_line":true,"single_line":true},"ordered_imports":{"sort_algorithm":"alpha"},"no_unneeded_control_parentheses":{"statements":["break","clone","continue","echo_print","return","switch_case","yield"]},"no_spaces_around_offset":{"positions":["inside","outside"]},"visibility_required":{"elements":["property","method","const"]},"no_unused_imports":true},"hashes":{"src\/Exceptions\/LaravelFejlvarpExceptionHandler.php":"7b9c2f820db39a2d09097ceffe798ab2","src\/Facades\/LaravelFejlvarp.php":"c79bb7365c831eb5cab20675593432d6","src\/LaravelFejlvarp.php":"bc4c671834d59581b772f524cb896bb0","src\/Components\/Ago.php":"3f73676fbcb3200c3d3db540736c00f8","src\/LaravelFejlvarpServiceProvider.php":"19fe369cd6960c3ad8d83d165ed362c4","src\/Http\/Controllers\/Api\/IncidentController.php":"8ec24d8d671eef8c8b4865d17e536e6d","src\/Http\/Controllers\/IncidentController.php":"8db4cc9484d8bb7c9a27834a4abffa14","src\/Http\/Requests\/IncidentStoreRequest.php":"4d13c1384e8d07bbe7878d3ec641e1d4","src\/Http\/Requests\/ApiRequest.php":"7e5c417b68cecb46aed8b1e6b9a99404","src\/Incident.php":"dfcf33908ac60f8b19f23bcd20b7b6c4","tests\/TestCase.php":"858f3585ee2e14df08dc659956ef13bc","tests\/Pest.php":"015a8f313bac5fe4743f5a6d3026ba96","tests\/ExampleTest.php":"3991be89aec886561a4e2d089f261a2a"}}
114 changes: 114 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,120 @@ All notable changes to `Laravel-Fejlvarp` will be documented in this file.

683d0d6

## v11.1.1 - 2024-06-30

### What's Changed

* Use Laravels base handler by @negoziator in https://github.com/tvup/laravel-fejlvarp/pull/21

**Full Changelog**: https://github.com/tvup/laravel-fejlvarp/compare/v11.1.0...v11.1.1

## Support for Laravel 11 - 2024-06-30

### What's Changed

* Add support for laravel 11 by @negoziator in https://github.com/tvup/laravel-fejlvarp/pull/20

### New Contributors

* @negoziator made their first contribution in https://github.com/tvup/laravel-fejlvarp/pull/20

**Full Changelog**: https://github.com/tvup/laravel-fejlvarp/compare/v11.0.0...v11.1.0

## v11.0.0 - 2024-01-20

### What's Changed

**Full Changelog**: https://github.com/tvup/laravel-fejlvarp/compare/v10.2.6...v11.0.0

#### Breaking changes

- **Remove `dontReport` field from handler** - It's not something the package should deal with; it's, of course, up to the user to choose these things.
- **Remove `dontFlash` field from handler** - It's not something the package should deal with; it's, of course, up to the user to choose these things. Besides, Laravel already has a suggestion for this field in the raw installation - even more reason not to override it.
- **Extend the Handler in the user's installation instead of the Laravel one** - We don't want to just ignore what the user has in his/her `Handler.php`.

*The behaviour after updating from previuos may dramatically change since your own Handler.php is now used again.*

## v10.2.6 - 2023-10-25

### What's Changed

**Full Changelog**: [https://github.com/tvup/laravel-fejlvarp/compare/v10.2.5.10...v10.2.6](https://github.com/tvup/laravel-fejlvarp/compare/v10.2.5.10...v10.2.6)

#### Primarily Under-the-Hood Changes

- **Middleware Update**: Removed the "admin" middleware attachment from routes.
- **Installation Ease**: Enhanced the installation process to ensure users can set up the package with minimal effort.
- **Dependencies**: Updated various 3rd party packages to their latest versions.

## v10.2.5.3 - 2023-08-02

**Full Changelog**: https://github.com/tvup/laravel-fejlvarp/compare/v10.2.5.2...v10.2.5.3

## v10.2.5.2 - 2023-08-02

**Full Changelog**: https://github.com/tvup/laravel-fejlvarp/compare/v10.2.5.1...v10.2.5.2

## v10.2.5.1 - 2023-08-02

**Full Changelog**: https://github.com/tvup/laravel-fejlvarp/compare/v9.1.4...v10.2.5.1

### Bugfix

## v10.2.5 - 2023-08-02

### What's Changed

**Full Changelog**: https://github.com/tvup/laravel-fejlvarp/compare/v9.1.4...v10.2.5
Laravel v10 campatible

## v9.1.5 - 2023-03-28

### What's Changed

**Full Changelog**: https://github.com/tvup/laravel-fejlvarp/compare/v9.1.4...v9.1.5

#### Bugfix

Fixes bug where all exceptions received were notified upon not just on new or reopen events

## v9.1.4 - 2023-03-17

### What's Changed

**Full Changelog**: https://github.com/tvup/laravel-fejlvarp/compare/v9.1.3...v9.1.4

#### Bugfix

Fixes bug were resolved_at wasn't set to null

## v9.1.3 - 2023-03-16

### What's Changed

**Full Changelog**: https://github.com/tvup/laravel-fejlvarp/compare/v9.1.1...v9.1.3

#### Bugfix

Fixes bug where every incident made a notication and not just for open/reopen

## v9.1.2 - 2023-03-16

Fixes bug where incidents weren't reopened

## v9.1.1 - 2023-03-14

### What's Changed

**Full Changelog**: https://github.com/tvup/laravel-fejlvarp/compare/v9.1.0...v9.1.1

#### Minor changes

- Adds type-hint for method fejlvarp_exception_handler. Corrects php-doc for function render
- Upgrade testbench version in test-flow for gh actions
- Adds missing phpunit.xml
- Up minimum stability

## v9.1.0 - 2023-03-14

### What's Changed
Expand Down
60 changes: 31 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# Simple incident logger for Laravel
# Laravel Fejlvarp: Your Go-To Incident Logger

[![Latest Version on Packagist](https://img.shields.io/packagist/v/tvup/laravel-fejlvarp.svg?style=flat-square)](https://packagist.org/packages/tvup/laravel-fejlvarp)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/tvup/laravel-fejlvarp/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/tvup/laravel-fejlvarp/actions?query=workflow%3Arun-tests+branch%3Amaster)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/tvup/laravel-fejlvarp/run-tests.yml?branch=master&label=tests&style=flat-square)](https://github.com/tvup/laravel-fejlvarp/actions?query=workflow%3Arun-tests+branch%3Amaster)
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/tvup/laravel-fejlvarp/php-cs-fixer.yml?branch=master&label=code%20style&style=flat-square)](https://github.com/tvup/laravel-fejlvarp/actions?query=workflow%3A"Check+&20+fix+styling"+branch%3Amaster)
[![Total Downloads](https://img.shields.io/packagist/dt/tvup/laravel-fejlvarp.svg?style=flat-square)](https://packagist.org/packages/tvup/laravel-fejlvarp)

Laravel Fejlvarp is an incident logger for Laravel.
Laravel Fejlvarp is a robust incident logger tailored for Laravel applications. Designed to streamline error tracking, it ensures that you're always in the loop about runtime errors, allowing for swift resolution.

The tool provides you with a place to log runtime errors.
**Why Choose Laravel Fejlvarp?**

The service can notify when an incident first happens or is reopened via mail or through pushover.net.
- **Instant Notifications:** Get notified immediately when an incident occurs or is reopened via email or pushover.net.
- **Intuitive Interface:** A user-friendly web interface lets you delve deep into debug information about each incident.
- **Seamless Integration:** Designed to fit right into your Laravel application without any hassle.

It offers a web based interface to see debug info about the incident:

| Incidents overview | Incident detail view |
|------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|
Expand All @@ -23,7 +24,11 @@ It offers a web based interface to see debug info about the incident:
This package is an enchancement of [Fejlvarp](https://github.com/troelskn/fejlvarp) by [troelskn](https://github.com/troelskn). Thanks for letting me envolve on the idea to letting it become a package for laravel.

## Versions
Major versions follows Laravel versions.
~~Major versions follows Laravel versions.~~

Previously, major versions followed Laravel versions. However, this practice was identified as an anti-pattern and has since been discontinued.

Starting from version 11, the corresponding Laravel version requirement is explicitly stated in the `composer.json` file.

## Installation

Expand All @@ -33,19 +38,28 @@ You can install the package via composer:
composer require tvup/laravel-fejlvarp
```

Default route to overview will be http://your-url.top/incidents
Default route to list of incidents will be http://your-url.top/incidents

You can publish and run the migrations with:
**Important! Make sure to protect this route with (admin) authentication**

You can enjoy the convenience of letteing the package install itsleft
```bash
php artisan fejlvarp:install
```
It will also ask you if you want to create (migrate) the table that will be storing the incidents


Instead of doing the above, or just if you are curious, you publish the files manually by doing the following:

You can publish and run the migrations with:
```bash
php artisan vendor:publish --tag="laravel-fejlvarp-migrations"
php artisan vendor:publish --tag="fejlvarp-migrations"
php artisan migrate
```

You can publish the config file with:

```bash
php artisan vendor:publish --tag="laravel-fejlvarp-config"
php artisan vendor:publish --tag="fejlvarp-config"
```

This is the contents of the published config file:
Expand Down Expand Up @@ -73,29 +87,19 @@ Results from ipstack are cached, so it won't drain the free lookups right away.
Pushover/slack/mail is used to inform about new og reopened incidents

Optionally, you can publish the views using

```bash
php artisan vendor:publish --tag="laravel-fejlvarp-views"
php artisan vendor:publish --tag="fejlvarp-views"
```

You can replace your exception-handler
Replace
```bash
php artisan vendor:publish --tag=fejlvarp-provider
```
$app->singleton(
'Illuminate\Contracts\Debug\ExceptionHandler',
'App\Exceptions\Handler'
);
```
with
```
$app->singleton(
'Illuminate\Contracts\Debug\ExceptionHandler',
'Tvup\LaravelFejlvarp\Exceptions\Handler'
);
```
remember to make sure that the serivce-provider is correctly installed

You can have other applications report to the one you install it on, get inspiration from
/src/Exceptions/Handler.php
/src/Exceptions/LaravelFejlvarpExceptionHandler.php
```php
$hash = config('app.name')
. $exception->getMessage()
Expand Down Expand Up @@ -133,8 +137,6 @@ $hash = config('app.name')
app()->handle($request);
```

## Usage

## Testing

```bash
Expand Down
26 changes: 13 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@
}
],
"require": {
"php": "^8.1",
"illuminate/contracts": "^9.0",
"nesbot/carbon": "^2.66",
"spatie/laravel-package-tools": "^1.14.0"
"php": "*",
"laravel/framework": "^9|^10|^11",
"nesbot/carbon": "^2|^3",
"spatie/laravel-package-tools": "^1.16"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.15",
"nunomaduro/collision": "^6.0",
"nunomaduro/larastan": "^2.5",
"orchestra/testbench": "^7.0",
"pestphp/pest": "^1.21",
"pestphp/pest-plugin-laravel": "^1.1",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^9.5",
"spatie/laravel-ray": "^1.26"
"friendsofphp/php-cs-fixer": "^3.35",
"nunomaduro/collision": "^7|^8",
"nunomaduro/larastan": "^2.6",
"orchestra/testbench": "^7|^8|^9",
"pestphp/pest": "^1|^2|^3",
"pestphp/pest-plugin-laravel": "^1|^2|^3",
"phpstan/phpstan-phpunit": "^1.3",
"phpunit/phpunit": "^9|^10|^11",
"spatie/laravel-ray": "^1.33"
},
"autoload": {
"psr-4": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public function up()
{
Schema::connection('app_api_no_prefix')->create('incidents', function (Blueprint $table) {
Schema::create('incidents', function (Blueprint $table) {
$table->string('hash', 32)->primary();
$table->string('subject', 255);
$table->longText('data');
Expand Down
1 change: 0 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ parameters:
# - '#no value type specified in iterable type array#'
#
excludePaths:
- ./src/Http/Controllers/IncidentController.php
# - ./*/*/FileToBeExcluded.php
#
# checkMissingIterableValueType: false
Loading

0 comments on commit e923632

Please sign in to comment.