PHPackages                             t-labs-co/laravel-marking - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. t-labs-co/laravel-marking

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

t-labs-co/laravel-marking
=========================

Laravel Marking, Just Mark it

1.0.2(11mo ago)07[3 PRs](https://github.com/T-Labs-Co/laravel-marking/pulls)MITPHPPHP ^8.4||^8.3||^8.2CI passing

Since Apr 8Pushed 1mo agoCompare

[ Source](https://github.com/T-Labs-Co/laravel-marking)[ Packagist](https://packagist.org/packages/t-labs-co/laravel-marking)[ Docs](https://github.com/t-labs-co/laravel-marking)[ GitHub Sponsors](https://github.com/ty-huynh)[ RSS](/packages/t-labs-co-laravel-marking/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (13)Versions (7)Used By (0)

Laravel Marking, Just Mark it
=============================

[](#laravel-marking-just-mark-it)

[![Latest Version on Packagist](https://camo.githubusercontent.com/124121e9454af461c31854b347d62169937859ca9fc619b45156767188f8bc16/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f742d6c6162732d636f2f6c61726176656c2d6d61726b696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/t-labs-co/laravel-marking)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/d894d9432514a672d72b40d4a2c76624dc5b5e2655109b7c9978fcdb226e6f14/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f742d6c6162732d636f2f6c61726176656c2d6d61726b696e672f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/t-labs-co/laravel-marking/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/c29ef9d07bd0a6709d8974d9b03a785ea778e93929564e0d3901338a922806b8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f742d6c6162732d636f2f6c61726176656c2d6d61726b696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/t-labs-co/laravel-marking)

Laravel Marking is a flexible package for managing and normalizing marks in Laravel applications. It provides tools for marking, classification, normalization, and customizable configurations to streamline your application's marking system.

Contact Us
----------

[](#contact-us)

(c) T.Labs &amp; Co. Contact for Work: T.

Got a PHP or Laravel project? We're your go-to team! We can help you:

- Architect the perfect solution for your specific needs.
- Get cleaner, faster, and more efficient code.
- Boost your app's performance through refactoring and optimization.
- Build your project the right way with Laravel best practices.
- Get expert guidance and support for all things Laravel.
- Ensure high-quality code through thorough reviews.
- Provide leadership for your team and manage your projects effectively.
- Bring in a seasoned Technical Lead.

Features
--------

[](#features)

This package is extend and support all feature like tagging package,

- `Mark Management`: Easily manage marks with a flexible and extensible structure.
- `Classification Support`: Classify marks into different categories for better organization.
- `Normalization`: Normalize mark values using customizable normalization logic.
- `Customizable Configurations`: Fully configurable via the marking configuration file.
- `Morphable Relationships`: Supports polymorphic relationships for marking multiple models.
- `Value Casting`: Automatically cast mark values based on their classification.

Support PHP and Laravel Version
-------------------------------

[](#support-php-and-laravel-version)

This package supports the following versions:

- **PHP**: `^8.2` or higher
- **Laravel**: `^11.0` or higher

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require t-labs-co/laravel-marking
```

You can publish the migrations and config with:

```
php artisan vendor:publish --provider="TLabsCo\LaravelMarking\MarkingServiceProvider"
```

The config `marking.php` content:

```
return [
    'delimiters' => ',;',
    'glue' => ',',
    'classifications' => array_merge(
        ['general'],
        Arr::dot(explode(',', env('LARAVEL_MARKING_CLASSIFICATIONS', '')))
    ),
    'default_classification' => env('LARAVEL_MARKING_CLASSIFICATION_DEFAULT', 'general'),
    'default_value' => env('LARAVEL_MARKING_VALUE_DEFAULT', 1), // using to count or sum point
    'values_caster' => [
        'general' => 'strval', //
    ],
    'normalizer' => 'snake_case',
    'connection' => null,
    'throwEmptyExceptions' => false,
    'markedModels' => [],
    'model' => \TLabsCo\LaravelMarking\Models\Mark::class,
    'tables' => [
        'marking_marks' => 'marking_marks',
        'marking_markables' => 'marking_markables',
    ],
];
```

Usage
-----

[](#usage)

### Add trait to your Models

[](#add-trait-to-your-models)

Your models should use the Markable trait:

```
use TLabsCo\LaravelMarking\Models\Markable;

class MyModel extends Eloquent
{
    use Markable;
}
```

### Adding and Removing Mark from a Model

[](#adding-and-removing-mark-from-a-model)

Mark your models with the `marking()` method:

```
// Pass in a delimited string:
$model->marking('Coffee,Cake,Fruit');

// Or an array:
$model->marking(['Coffee', 'Cake', 'Fruit']);
```

You can remove marks individually with `unmarking()` or entirely with `demarking()`:

```
$model->marking('Coffee,Cake,Fruit');

$model->unmarking('Fruit');
// $model is now just marked with "Coffee" and "Cake"

$model->demarking();
// $model has no marks anymore
```

### Apply classification your marks

[](#apply-classification-your-marks)

Config your classification from config file `marking.php`

```
  'classifications' => ['general', 'drink', 'food']
```

Mark your models with your desired classification

```
// Pass in a delimited string:
$model->marking('Cake,Fruit', classification: 'food');

// Or an array:
$model->marking(['Coffee'], classification: 'drink');
```

### Save the value to your marks

[](#save-the-value-to-your-marks)

Config your value caster depend by classification from config file `marking.php`

```
  'values_caster' => [
      'food' => 'intval', //
  ],
```

Mark your models with your desired value

```
// Pass in a delimited string:
$model->marking('Fruit', ['value' => 2], classification: 'food');

// Or an array:
$model->marking([['name' => 'Coffee', 'value' => 2]], classification: 'drink');

// Or an array:
$model->marking(['Coffee' =>  ['value' => 2]], classification: 'drink');
```

### Interact with the value from your marks

[](#interact-with-the-value-from-your-marks)

Your models should use the `Markable` and `InteractMarkableValue` trait:

```
use TLabsCo\LaravelMarking\Models\Markable;
use TLabsCo\LaravelMarking\Models\InteractMarkableValue;

class MyModel extends Eloquent
{
    use Markable;
    use InteractMarkableValue;
}
```

You also add value to your mark

```
// Get values map by classification
$model->getMarkingValuesMap('food'); // ['Cake' => 1, 'Fruit' => 2]

// Sum vallues map by classification
$model->sumMarkingValues('food'); // 3

// Update or Add your mark with value in particular classification
$model->updateMarkingValue('Cake', 5, 'food'); // 'Cake' => 5
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [T.](https://github.com/ty-huynh)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance74

Regular maintenance activity

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~31 days

Total

3

Last Release

337d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b8096712a46f142a708061822c0644b806cd1000cb5499e408c6b11b12f6a899?d=identicon)[t-labs-co](/maintainers/t-labs-co)

---

Top Contributors

[![ty-huynh](https://avatars.githubusercontent.com/u/1597540?v=4)](https://github.com/ty-huynh "ty-huynh (26 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")

---

Tags

laravelmarkablemarkingpackagephptaggabletagginglaravelT.Labs Co.laravel-tagginglaravel-markinglaravel-markable

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/t-labs-co-laravel-marking/health.svg)

```
[![Health](https://phpackages.com/badges/t-labs-co-laravel-marking/health.svg)](https://phpackages.com/packages/t-labs-co-laravel-marking)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
