Download the PHP package plopster/trace-code-maker without Composer

On this page you can find all versions of the php package plopster/trace-code-maker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package trace-code-maker

TraceCodeMaker Library

Overview

TraceCodeMaker is a modern Laravel library designed to create and manage unique trace codes for monitoring, logging, and tracing errors or responses within services. The library features automatic installation, caching support, and comprehensive configuration options.

Features

Requirements

Quick Installation

Step 1: Install via Composer

Step 2: Run Installation Command

That's it! 🎉 The installation command will:

Manual Installation (Alternative)

If you prefer manual installation:

1. Install Package

2. Publish Files

3. Run Migration

Configuration

After installation, you can customize the library by editing the published configuration file:

Configuration Options

Default Service

Sets the default service name when none is provided.

Trace Code Format

Customize how trace codes are generated.

Database Settings

Configure database connection and table name.

Cache Settings

Enable/disable caching and set cache duration.

Validation Rules

Customize validation rules for input parameters.

Environment Variables

You can configure the library using environment variables in your .env file:

Performance Optimization

Caching

The library includes built-in caching to improve performance:

Database Indexes

The migration includes optimized indexes for:

Memory Usage

Usage

After installation, you can use TraceCodeMaker anywhere in your Laravel application.

Basic Usage

Advanced Usage Examples

In Exception Handling

In Middleware

Using Configuration Defaults

Response Format

The fetchOrCreateTraceCode method returns an array with the following structure:

Success Response:

Error Response:

Trace Code Format

Generated trace codes follow this pattern: {SERVICE_CODE}-{HTTP_CODE}-{METHOD_HASH}-{TIMESTAMP}{RANDOM_SUFFIX}

Example: USR-500-a1b2c-240101123045ABCD

Testing

The library includes comprehensive tests. To run them:

Test Database

Tests use SQLite in-memory database by default. You can configure this in phpunit.xml.

Troubleshooting

Common Issues

Migration Not Found

Cache Issues

Service Provider Not Registered

For Laravel 10 and below, manually add to config/app.php:

Database Connection Issues

Ensure your database configuration is correct:

Debug Mode

Enable debug logging by setting:

Version Compatibility

Laravel Version PHP Version Package Version
12.x 8.1+ 1.0+
11.x 8.1+ 1.0+
10.x 8.1+ 1.0+
9.x 8.1+ 1.0+

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Setup

Coding Standards

License

This project is open-sourced software licensed under the MIT license.

Support

If you encounter any issues or have questions:

Changelog

v1.0.0


All versions of trace-code-maker with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
illuminate/database Version ^9.0|^10.0|^11.0|^12.0
illuminate/console Version ^9.0|^10.0|^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package plopster/trace-code-maker contains the following files

Loading the files please wait ....