承接 onramplab/laravel-exceptions 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

onramplab/laravel-exceptions

最新稳定版本:v1.3.0

Composer 安装命令:

composer require onramplab/laravel-exceptions

包简介

Handling Laravel exceptions for logs and API response

README 文档

README

Software License CircleCI Total Downloads

If you are trying to create a new PHP Composer package, whether it is going to be submitted to packagist.org or just to exist in your Github account, this template package of files will surely help you make the process a lot easier and faster.

Requirements

  • PHP >= 8.1;
  • composer.

Features

  • Follow JSON API Spec
  • Add more context to log for errors
    • adapter
      • Web
      • Console
      • Job

API Error Response Example

{ "errors": [ { "title": "Resource Not Found", "detail": "User Not Found", "message": "User Not Found", "status": 400 } ] }

Error Log Example

Here is the example of error log context: ```json { "detail": "A fake message", "adapter": { "type": "API", "route": "test-route", "method": "GET", "url": "http://localhost/test-route", "input": [] }, "errors": [ { "title": "Unable To Do Something", "detail": "A fake message", "exception_class": "OnrampLab\\CleanArchitecture\\Exceptions\\UseCaseException", "stacktrace": [ "## /var/www/html/tests/Unit/Exceptions/HandlerTest.php(149)", "#0 /var/www/html/vendor/phpunit/phpunit/src/Framework/TestCase.php(1548): OnrampLab\\CleanArchitecture\\Tests\\Unit\\Exceptions\\HandlerTest->handleUseCaseException2()" ] }, { "title": "Fake Domain Exception", "detail": "A fake message", "exception_class": "OnrampLab\\CleanArchitecture\\Tests\\Unit\\Exceptions\\FakeDomainException", "stacktrace": [ "## /var/www/html/tests/Unit/Exceptions/HandlerTest.php(146)", "#0 /var/www/html/vendor/phpunit/phpunit/src/Framework/TestCase.php(1548): OnrampLab\\CleanArchitecture\\Tests\\Unit\\Exceptions\\HandlerTest->handleUseCaseException2()" ] } ] } 
 ## Tech Features - PSR-4 autoloading compliant structure; - PSR-2 compliant code style; - Unit-Testing with PHPUnit 6; - Comprehensive guide and tutorial; - Easy to use with any framework or even a plain php file; - Useful tools for better code included. ## Installation ```bash composer require onramplab/laravel-exceptions 

Useful Tools

Running Tests:

php vendor/bin/phpunit 

or

composer test 

Code Sniffer Tool:

php vendor/bin/phpcs --standard=PSR2 src/ 

or

composer psr2check 

Code Auto-fixer:

composer psr2autofix composer insights:fix rector:fix 

Building Docs:

php vendor/bin/phpdoc -d "src" -t "docs" 

or

composer docs 

Changelog

To keep track, please refer to CHANGELOG.md.

Contributing

  1. Fork it.
  2. Create your feature branch (git checkout -b my-new-feature).
  3. Make your changes.
  4. Run the tests, adding new ones for your own code if necessary (phpunit).
  5. Commit your changes (git commit -am 'Added some feature').
  6. Push to the branch (git push origin my-new-feature).
  7. Create new pull request.

Also please refer to CONTRIBUTION.md.

License

Please refer to LICENSE.

统计信息

  • 总下载量: 18.48k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固