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-09-10 16:52:29 UTC
README
安装
composer require aw-studio/laravel-content-parser
使用
use AwStudio\ContentParser\Content; class Site extends Model { protected $casts = [ 'content' => Content::class, ]; }
使用关系
设置相关查询
class Site extends Model { // ... public function authorQuery() { return User::query(); } }
一个关系
[ { "type": "author", "value": "relation://author@1" } ]
多个关系
[ { "type": "author", "value": "relation://author@1,2" } ]