statamic-rad-pack / runway

Eloquently manage your database models in Statamic.
https://statamic.com/runway
MIT License
107 stars 42 forks source link

[7.x] Publish States #506

Closed duncanmcclean closed 1 month ago

duncanmcclean commented 1 month ago

This pull request adds the ability to mark models as published & unpublished, with all the expected filtering of unpublished models in Antlers, the GraphQL API, Search, etc.

This might come in useful if you're using Runway to store some kind of content and you don't want to have to do all the filtering etc yourself.

To enable, simply add the published config option to a resource's config array, and either set it to true (which will assume the model has a published boolean column) or another column of your choosing.

'resources' => [
    \App\Models\Order::class => [
        'name' => 'Orders',
        'published' => true,
        'published' => 'active',
    ],
],

This PR will be helpful when we introduce support for Revisions, which is coming soon, see #492.

Related: https://github.com/statamic-rad-pack/runway/discussions/294

github-actions[bot] commented 1 month ago

Released as part of v7.2.0.