carsdotcom / laravel-json-model
Laravel models backed by JSON data
v1.4.5
2026-03-18 15:07 UTC
Requires
- php: ^8.1
- ext-json: *
- carsdotcom/laravel-json-schema: ^v1.0.1 || ^v2 || ^2.1
- laravel/framework: ^9.19 || ^10.0 || ^11.0 || ^12.0
Requires (Dev)
- fakerphp/faker: ^1.9.1
- mockery/mockery: ^1.4.4
- nunomaduro/collision: ^6.1|7.*|8.*
- orchestra/testbench: 7.*|8.*|9.*|10.*
- phpstan/phpstan: ^1.8|^2.1
- phpunit/phpunit: ~8.0|~9.0|^10.5|^11.5.3
- squizlabs/php_codesniffer: ^3.7
- dev-development
- v1.4.5
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.0
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.1
- v1.0.0
- dev-explicit-null
- dev-phpstan-extension
- dev-fix/remove-has-relationships
- dev-feat/PHP-8.4
- dev-issue-16
- dev-MR-NaN/laravel-12
- dev-safe-attribute-mutator
- dev-issue-11
- dev-safe-update-includes-custom-saving
- dev-bbene-laravel-10-support
- dev-bbene-json-schema-update
- dev-onshop-feature-true-up
This package is auto-updated.
Last update: 2026-03-18 15:43:39 UTC
README
We really love Laravel as an ORM. But we have a part of our application that persists to a document store, not a relational database. Json Models let us use the best parts of the Eloquent Models, but instead of being backed by a row in a table, they're always serialized to JSON. (Which can include being serialized to an attribute on a traditional Laravel Model!)
Setup
For now, you will need to add the following for events to work properly.
- In AppServiceProvider boot method:
JsonModel::setEventDispatcher($this->app['events']); - In AppServiceProvider register method:
JsonModel::clearBootedModels();