Skip to content
/ draft Public

[READ-ONLY] Draftable Entity for Laravel and Filament

License

Notifications You must be signed in to change notification settings

mooxphp/draft

Repository files navigation

Moox Draft

Moox Draft

Draft is a publishable Moox Entity that can be used to create and manage Pages, Posts, etc.

Features

  • Publish (or schedule)
  • Unpublish (or schedule)
  • Soft Delete
  • Supports Taxonomies
  • Supports Relations
  • Supports Modules
  • Title with Slug fields
  • Active field (Toggle)
  • Description field (Editor)
  • Content field (Markdown)
  • Data field (Key-Value)
  • Image field (Media)
  • Author field (User)
  • Type field (Select)
  • Due field (DateTime)
  • Color field (Color)
  • UUID field (UUID)
  • ULID field (ULID)

Requirements

See Requirements.

Installation

composer require moox/draft
php artisan moox:install

Curious what the install command does? See Installation.

Screenshot

Moox Draft

Get Started

See Get Started.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Roadmap

Please see ROADMAP for more information on what is planned for this package.

Security

Please review our security policy on how to report security vulnerabilities.

Credits

Thanks to so many people for their contributions to this package.

License

The MIT License (MIT). Please see our license and copyright information for more information.

The Draft Model

The Draft model comes with several powerful features and capabilities:

Attributes

Base Fields

  • is_active (boolean) - Activation status
  • data (json) - Flexible JSON data storage
  • type - Content type (Post/Page)
  • status - Publication status (draft/waiting/private/scheduled/published)
  • color - Custom color coding
  • due_at (datetime) - Due date
  • uuid - Universally Unique Identifier
  • ulid - Universally Unique Lexicographically Sortable Identifier

Translated Fields

  • title - Content title
  • slug - URL-friendly identifier
  • description - Brief description
  • content - Main content
  • author_id - Content author reference
  • to_publish_at - Scheduled publish date
  • published_at - Actual publish date
  • to_unpublish_at - Scheduled unpublish date
  • unpublished_at - Actual unpublish date

Media Handling

  • Supports media attachments via Spatie Media Library
  • Automatic image conversions for previews
  • Media relationship through usables

Publishing Workflow

  • Scheduled publishing support
  • Publication status tracking
  • Unpublishing capability
  • Audit trail for publishing actions

Methods

Publishing Related

  • isScheduledForPublishing() - Check if content is scheduled
  • isPublished() - Check publication status
  • isScheduledForUnpublishing() - Check unpublishing schedule
  • isUnpublished() - Check if unpublished
  • handleSchedulingDates() - Manage scheduling dates
  • handlePublishingDates() - Handle publication dates

Query Scopes

  • scopeScheduledForPublishing()
  • scopePublished()
  • scopeScheduledForUnpublishing()
  • scopeUnpublished()
  • scopeRestored()

Relationships

  • author() - Author relationship
  • publishedBy() - Publishing actor
  • updatedBy() - Update actor
  • createdBy() - Creation actor
  • unpublishedBy() - Unpublishing actor
  • deletedBy() - Deletion actor
  • restoredBy() - Restoration actor

Features

  • Soft deletes support
  • Multi-language support
  • Taxonomy integration
  • Automatic UUID/ULID generation
  • Media library integration
  • Publishing workflow management
  • Audit trail for all major actions

About

[READ-ONLY] Draftable Entity for Laravel and Filament

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages