spatie

spatie/laravel-schemaless-attributes

PHP MIT Web Dev

Add schemaless attributes to Eloquent models

1.1k stars
53 forks
slow
GitHub +1 / week

1.1k

Stars

53

Forks

0

Open issues

24

Contributors

2.6.0 21 Feb 2026

AI Analysis

This Laravel package adds NoSQL-like schemaless attributes to Eloquent models by storing arbitrary JSON data in a single database column. It is purpose-built for Laravel developers who need flexible, unstructured data storage without database migrations for each new attribute, making it ideal for applications with highly dynamic data schemas.

Web Dev Library Discovery value: 4/10
Documentation 8/10
Activity 9/10
Community 8/10
Code quality 7/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 8/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

laravel-package json-storage eloquent-extension schema-flexibility nosql-emulation
Actively maintained Well documented MIT licensed Niche/specialized use case Beginner friendly Production ready
Deep Analysis · Based on README and public signals
3d ago

Spatie's Schemaless JSON Storage for Laravel—Stable, Mature, Limited Growth

laravel-schemaless-attributes provides a trait for Laravel Eloquent models to store arbitrary JSON data in a single database column, bridging relational and document-oriented patterns. Built by Spatie, a prolific PHP open source publisher, it serves Laravel developers who need flexible schema evolution without migrations for certain attributes. Downloads and integration are steady but not accelerating; the package occupies a permanent niche for projects valuing schema flexibility within a relational model.

Origin

Created May 2018 by Spatie, the package emerged as JSON column support matured in MySQL 5.7+. It addressed a practical tension: Laravel applications needed some schemaless flexibility without abandoning Eloquent. Spatie's reputation and consistent package maintenance ensured early adoption within the Laravel ecosystem.

Growth

The package gained traction through 2019–2022 as Laravel versions 6–8 stabilized and JSON columns became standard. Growth plateaued by 2023–2024; the 1,084 stars and 1 star gained in the past 7 days reflect mature-market saturation. Adoption appears to have settled into a stable, predictable user base rather than expanding into new use cases. No evidence of viral adoption or major ecosystem shifts driving new interest.

In production

Packagist download metrics mentioned in README but specific numbers not provided in excerpt. 1,084 GitHub stars and 53 forks suggest meaningful but not dominant adoption. Spatie's track record (sibling packages like laravel-translatable at 2,455 stars and laravel-tags at 1,746 stars) implies this package likely has production users, but adoption not explicitly verified through case studies, blog posts, or referenced organizations in README.

Code analysis
Architecture

Based on README, the package provides a custom Eloquent cast (`SchemalessAttributes`) that wraps JSON column data and exposes it via dot-notation accessors and array-like syntax. It likely uses PHP property magic methods (`__get`, `__set`) for fluent attribute access. A trait-based approach allows multiple schemaless columns per model. Architecture appears straightforward: a thin wrapper over Laravel's native JSON support rather than a complex abstraction.

Tests

README mentions GitHub Actions workflow badge for tests, indicating automated testing is in place. Specific coverage metrics not documented in README excerpt. Evidence of CI/CD suggests quality gates exist, but depth is not disclosed.

Maintenance

Last push June 2, 2026 (5 weeks before evaluation date) indicates active maintenance. Repository has not entered maintenance-only mode. However, infrequency of recent star gains and low fork count (53) suggest the package is not experiencing urgent feature requests or competitive pressure. Maintenance appears healthy but not growth-focused.

Honest verdict

ADOPT IF: you are building a Laravel application using MySQL 5.7+ that requires flexible, unstructured attribute storage on specific model fields without adding database migrations for each new field, and you value Spatie's maintenance track record and simple API. AVOID IF: your entire application domain is schemaless (use a document database instead), or you prioritize cutting-edge feature velocity and community innovation (this is mature and stable, not growing). MONITOR IF: you are considering laravel-data or other newer Spatie packages that may overlap in functionality—evaluate whether the broader abstraction provides better fit for your data modeling strategy.

Independent dimensions

Mainstream potential

3/10

Technical importance

5/10

Adoption evidence

5/10

Risks
  • Dependency on MySQL/PostgreSQL JSON support—not portable to older database versions. No built-in support for databases lacking native JSON types.
  • Potential performance degradation if querying deeply nested schemaless attributes at scale; dot-notation queries on JSON may not use indexes as efficiently as structured columns.
  • API surface is minimal and unlikely to expand significantly. Future Laravel versions may make this package redundant (e.g., if Laravel adds native schemaless attribute casting helpers).
  • Limited documentation of real-world use case specifics—README shows examples but does not discuss when schemaless attributes should or should not be used versus schema normalization.
  • Ownership concentration: Spatie maintains many Laravel packages; if Spatie's Laravel investment shifts, maintenance could slow or transfer to community with less institutional support.
Prediction

laravel-schemaless-attributes will likely remain in steady maintenance mode through 2027–2028, serving its established user base without significant growth or major feature additions. It will not become a dominant Laravel ecosystem tool, but will remain a reliable, known option for a specific use case. Gradual drift toward Laravel's native JSON support improvements may reduce perceived need over time.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

PHP
100%

Information

Language
PHP
License
MIT
Last updated
1mo ago
Created
100mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Open issues

No open issues — clean slate.

Open pull requests

No open pull requests.

Similar repos

spatie

spatie/laravel-translatable

A Laravel trait that makes Eloquent models translatable by storing translations...

2.5k PHP Web Dev
staudenmeir

staudenmeir/eloquent-json-relations

This Laravel Eloquent extension enables relationships to be defined using JSON...

1.1k PHP Web Dev
spatie

spatie/laravel-data

laravel-data provides a unified PHP object abstraction for Laravel...

1.8k PHP Web Dev
spatie

spatie/laravel-tags

A Laravel package that adds tagging capabilities to Eloquent models with a...

1.7k PHP Web Dev
spatie

spatie/laravel-sluggable

Laravel-sluggable is a Laravel package that automatically generates unique,...

1.6k PHP Web Dev
vs. alternatives
Laravel native JSON casting & accessors

Built into Laravel since 5.1+. Offers basic get/set without the dot-notation querying and model scope helpers this package provides. Laravel-schemaless-attributes adds developer ergonomics; competing directly with framework features limits market size.

staudenmeir/eloquent-json-relations (1,080 stars)

Overlaps in scope—both address JSON column work in Eloquent. eloquent-json-relations focuses on relationship queries across JSON fields; laravel-schemaless-attributes focuses on flexible attribute storage. Slightly different use cases, similar star count suggests market split.

spatie/laravel-data (1,771 stars)

Broader data-object abstraction layer. Can complement or substitute for schemaless attributes in some workflows. Spatie's own newer package may canibalize adoption of laravel-schemaless-attributes for some teams.

NoSQL databases (MongoDB, DynamoDB)

Solve the underlying problem (schemaless storage) at the database level. Organizations choosing fully document-oriented databases bypass this package entirely. Laravel-schemaless-attributes is for teams committed to relational databases but needing tactical flexibility.

spatie/laravel-model-status (1,058 stars)

Similar adoption profile and Spatie authorship. Both are stable, specialized tools serving narrow, well-defined needs within Laravel. Neither competes for dominance; both succeed by addressing specific workflows efficiently.