Download the PHP package masum/laravel-tagging without Composer

On this page you can find all versions of the php package masum/laravel-tagging. 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 laravel-tagging

Laravel Tagging

Latest Version Total Downloads License PHP Version Laravel Version

A comprehensive Laravel package for automatic tag generation and management with barcode support, events, and performance optimizations.


Overview

Laravel Tagging is a powerful, production-ready package that provides automatic tag generation and management for any Eloquent model. Perfect for inventory systems, asset tracking, equipment management, and any application requiring unique identifiers with barcode support.

Why Laravel Tagging?


Table of Contents


Requirements


Installation

Install the package via Composer:

Publish and run migrations:

Optional: Publish the configuration file:


Quick Start

1. Add the Trait to Your Model

2. Create a Tag Configuration

Important: The model field requires the fully qualified class name (e.g., \App\Models\Equipment::class or 'App\\Models\\Equipment').

3. Create Models - Tags Generated Automatically!

That's it! Tags are now automatically generated for all Equipment models. 🎉


Testing with Tinker

You can quickly test the package using Laravel Tinker. Here's a complete walkthrough:

Step 1: Start Tinker

Step 2: Create Tag Configuration

Expected Output:

Step 3: Create Equipment and See Tags Auto-Generate

Step 4: Verify Tags in Database

Step 5: Test Tag Search

Step 6: Test Eager Loading

Step 7: Test Tag Deletion

Quick Verification Script

Copy and paste this into Tinker for a complete test:


Features

✨ Core Features

Feature Description
Automatic Generation Tags generated on model creation
Multiple Formats Sequential, Random, Branch-based
Polymorphic Tag any Eloquent model
Barcode Support CODE_128, QR, EAN, UPC, and more
Print Labels Print-ready barcode labels
Events System 4 events for extensibility
Bulk Operations Efficient batch processing
RESTful API Complete API endpoints
Caching Performance optimizations
Race Protection Concurrent tag generation safe
Security Input validation, SQL injection prevention
Exceptions Specific exception classes
N+1 Prevention Query optimization
Comprehensive Tests Unit and feature tests included

🔢 Tag Generation Formats

Sequential Tags

Perfect for inventory systems requiring ordered numbering:

Random Tags

Great for high-concurrency systems:

Branch-Based Tags

Ideal for multi-location tracking:

📊 Barcode Generation

Generate barcodes in multiple formats for physical tagging:

Via API:

Supported Formats: CODE_128, CODE_39, EAN_13, UPC, QR_CODE, and more

🔔 Events & Webhooks

Hook into tag lifecycle for custom logic:

🔄 Bulk Operations

Efficient batch processing for large datasets:

Bulk Regenerate:

Bulk Delete:

Features:

📱 RESTful API

Complete API for frontend/mobile apps:

Tag Configurations:

Tags:

Meta Endpoints:

Full OpenAPI 3.0 specification available in docs/openapi.yaml


Configuration

The package is highly configurable. Publish the config file:

Key Configuration Options

Environment Variables


Usage

Basic Usage

Accessing Tags

Manual Tag Management

Querying by Tags

Advanced Features

Custom Print Labels

Customize what appears on printed labels:

Label output:

Exception Handling

Custom Tag Generation Logic

Override generation methods in your model:

API Integration

JavaScript/TypeScript Example

Vue.js Example


Performance

Avoiding N+1 Queries

Always use eager loading when loading multiple models with tags:

The package logs N+1 warnings in debug mode.

Caching

Tag configurations are automatically cached:

Cache is automatically invalidated on config updates.

Race Condition Protection

Sequential tag generation uses pessimistic locking:

Performance Targets

Database Indexes

Automatically created for optimal performance:


Security

Built-in Security Features

Input Validation - Length limits, character whitelisting ✅ SQL Injection Prevention - Parameterized queries, escaped wildcards ✅ XSS Prevention - Output escaping in barcode generation ✅ Error Handling - Secure error messages in production ✅ Rate Limiting - Configurable via middleware ✅ CSRF Protection - Laravel default protection

Security Best Practices

Full security policy available in SECURITY.md


Testing

The package includes a comprehensive test suite:

Test Coverage

Target: 80%+ code coverage


Documentation

Available Documentation

Quick Links

Interactive API Documentation

View interactive API docs with Swagger:

Access at http://localhost:8080


Troubleshooting

Tags Not Generated Automatically

If tags are not being generated when you create models, check the following:

1. Model Uses the Trait

2. TagConfig Uses Full Namespace

Wrong:

Correct:

3. Migrations Are Run

Make sure you've published and run all migrations:

This will create 3 migration files:

4. TagConfig Exists

Verify your tag configuration exists:

5. Check Logs

Enable debug mode and check logs for errors:

Tag generation errors are logged to storage/logs/laravel.log.

Common Issues

Issue: "No configuration found for model"

Solution: Create a TagConfig with the correct full namespace:

Issue: "Duplicate tag errors"

Solution: The improvements migration adds unique constraints. If you have existing duplicate tags:

Issue: "Tags are sequential but starting from wrong number"

Solution: Reset the counter in tag_configs:

Issue: "N+1 query warnings in logs"

Solution: Use eager loading:

Debug Mode

Enable verbose logging to troubleshoot issues:

Then check storage/logs/laravel.log for detailed error messages.


Changelog

All notable changes are documented in CHANGELOG.md.

Latest Version

Version 1.1.0 - Current Development

Added:

Fixed:

See CHANGELOG.md for complete history


Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

Quick Contribution Guide

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

Development Setup

Code of Conduct

This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code.


Credits

Author

Dependencies

Contributors

Thank you to all contributors who have helped make this package better!


License

This package is open-sourced software licensed under the MIT License.


Support


Made with ❤️ for the Laravel community

If this package helped you, please consider giving it a ⭐ on GitHub!


All versions of laravel-tagging with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2|^8.3
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/database Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0
illuminate/routing Version ^10.0|^11.0|^12.0
picqer/php-barcode-generator Version ^3.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 masum/laravel-tagging contains the following files

Loading the files please wait ...