PHPackages                             carlxaeron/general - 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. carlxaeron/general

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

carlxaeron/general
==================

A Laravel package providing general mapping and meta functionality for flexible model relationships and metadata management

v1.0.11(8mo ago)1784MITPHPPHP ^8.1

Since Aug 16Pushed 8mo agoCompare

[ Source](https://github.com/carlxaeron/general)[ Packagist](https://packagist.org/packages/carlxaeron/general)[ RSS](/packages/carlxaeron-general/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (4)Used By (0)

Carlxaeron General Package
==========================

[](#carlxaeron-general-package)

A Laravel package providing general mapping and meta functionality for flexible model relationships and metadata management.

Features
--------

[](#features)

- **General Maps**: Create flexible, polymorphic relationships between any models
- **General Meta**: Add custom metadata to any model
- **Helper Functions**: Global helper functions for easy access
- **Traits**: Easy-to-use traits for models
- **Configurable**: Customizable table names and settings
- **Laravel 10/11/12 Compatible**: Works with modern Laravel versions

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

[](#installation)

### Via Composer

[](#via-composer)

```
composer require carlxaeron/general
```

### Manual Installation

[](#manual-installation)

1. Clone or download this package to your project
2. Add the package to your `composer.json`:

```
{
    "require": {
        "carlxaeron/general": "*"
    }
}
```

3. Run `composer install`

Setup
-----

[](#setup)

### 1. Publish Configuration (Optional)

[](#1-publish-configuration-optional)

```
php artisan vendor:publish --tag=general-config
```

This will publish the configuration file to `config/general.php`.

### 2. Publish Migrations (Optional)

[](#2-publish-migrations-optional)

```
php artisan vendor:publish --tag=general-migrations
```

This will publish the migrations to your `database/migrations` folder.

### 3. Run Migrations

[](#3-run-migrations)

```
php artisan migrate
```

Usage
-----

[](#usage)

### Using Traits

[](#using-traits)

#### HasGeneralMaps Trait

[](#hasgeneralmaps-trait)

Add the `HasGeneralMaps` trait to any model you want to have relationships with other models:

```
