aw-studio / laravel-content-parser
dev-main
2021-12-10 10:45 UTC
Requires
- php: ^8.0
- guzzlehttp/guzzle: ^7.3
- illuminate/console: ^8.0
- illuminate/contracts: ^8.73
- illuminate/database: ^8.0
- illuminate/support: ^8
Requires (Dev)
- illuminate/testing: ^8.0
- mockery/mockery: ^1.4
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.4
This package is auto-updated.
Last update: 2024-11-10 17:14:28 UTC
README
Install
composer require aw-studio/laravel-content-parser
Usage
use AwStudio\ContentParser\Content; class Site extends Model { protected $casts = [ 'content' => Content::class, ]; }
Using Relationships
Setup the related query:
class Site extends Model { // ... public function authorQuery() { return User::query(); } }
One relation:
[ { "type": "author", "value": "relation://author@1" } ]
Many relation:
[ { "type": "author", "value": "relation://author@1,2" } ]