Download the PHP package abdylreshit/laravel-eav without Composer

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

Laravel EAV

A lightweight, powerful EAV (Entity-Attribute-Value) package for Laravel. Add dynamic, typed attributes to any Eloquent model without modifying your database schema. Perfect for e-commerce platforms, CMS systems, and applications requiring flexible data structures.

Features

Dynamic Attributes - Add unlimited attributes to any model without schema changes
🎯 Type Support - String, text, integer, decimal, boolean, date, datetime, JSON, image, and file types
Validation Ready - Built-in validation support for attribute values
🔍 Easy Querying - Filter models by EAV attributes with fluent API
🌍 Translatable - Support for multi-language attribute names
📦 Zero Configuration - Works out of the box with sensible defaults
🚀 Performance Optimized - Efficient queries with eager loading support

Installation

Install the package via Composer:

The package will auto-discover and register its service provider.

Configuration

Publish the migration:

Run the migration:

This creates the necessary tables: attributes and attribute_values.

Quick Start

1. Add the Trait to Your Model

2. Create Attributes

3. Use Attributes on Your Model

Querying with Attributes

Filter models by attribute values:

Attribute Types

The package supports the following attribute types:

Type Description Column
STRING Short text string_value
TEXT Long text text_value
INTEGER Whole numbers integer_value
DECIMAL Decimal numbers decimal_value
BOOLEAN True/false boolean_value
DATE Date (Y-m-d) date_value
DATETIME DateTime (Y-m-d H:i:s) datetime_value
JSON JSON data json_value
IMAGE Image file image_value
FILE File attachment file_value

Define Attribute Type

Translatable Attributes

Attribute names are translatable out of the box:

Eager Loading

Eager load EAV values with your model to avoid N+1 queries:

Validation

Validate EAV attributes in your request:

Available Methods

Getting Attributes

Setting Attributes

Deleting Attributes

Querying

Relationships

Database Schema

Attributes Table

Attribute Values Table

Examples

E-Commerce Product Catalog

CMS Page Attributes

Performance Tips

  1. Use Eager Loading - Always eager load EAV values when querying multiple models
  2. Index the code Column - Add a database index to attributes.code for faster queries
  3. Cache Attributes - Cache commonly used attributes
  4. Batch Operations - Use batch setting/getting instead of individual calls

Console Commands

Publish Assets

Publishes migrations and configuration files.

Migrate EAV Tables

Runs EAV-specific migrations.

Troubleshooting

Attribute Not Found

Ensure the attribute exists before setting a value:

N+1 Query Problem

Use eager loading:

Type Mismatch

Ensure the value type matches the attribute type:

License

The Laravel EAV package is open-sourced software licensed under the MIT license.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

For support, please open an issue on the GitHub repository.

Changelog

See CHANGELOG.md for recent changes.

Credits

Created by Abdylreshit


Made with ❤️ for Laravel developers


All versions of laravel-eav with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^12.0
illuminate/database Version ^12.0
illuminate/console Version ^12.0
spatie/laravel-translatable Version ^6.11
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 abdylreshit/laravel-eav contains the following files

Loading the files please wait ...