Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Propel Publishable Behavior

Propel Publishable Behavior Laravel Package

willdurand/propel-publishable-behavior

Propel behavior that adds publish/unpublish support to your models and queries. Provides isPublished(), publish()/unpublish(), optional publication timeframes (start/end), and query filters to include/exclude unpublished records or fetch currently active publications.

View on GitHub
Deep Wiki
Context7

The PublishableBehavior is designed to quickly add publish/unpublish features to your model.

Frequently asked questions about Propel Publishable Behavior
Can I use this package with Laravel’s default Eloquent ORM?
No, this package is designed exclusively for Propel ORM, which is not natively supported in Laravel. If you’re using Eloquent, you’ll need alternatives like `SoftDeletes` or custom scopes to replicate publish/unpublish functionality.
What Laravel versions does this package support?
This package is archived and targets older Laravel setups using Propel 1.x, which likely aligns with PHP 5.4–7.0. Modern Laravel (PHP 8.0+) may require polyfills or forks, but it’s not officially supported.
How do I install this in a Laravel project using Propel?
Add the package via Composer (`willdurand/propel-publishable-behavior`), then configure it in `propel.ini` or `build.properties` with the path `vendor.willdurand.propel-publishable-behavior.src.PublishableBehavior`. Follow the README’s Propel-specific setup.
What’s the difference between `isPublished()` and `filterPublished()`?
`isPublished()` checks if a single model instance is published, while `filterPublished()` is a query method to retrieve only published records from a dataset. Both respect the `is_published_column` and timeframe settings configured in the behavior.
Does this package support scheduled publishing (e.g., publish at a future date)?
Yes, if you enable timeframe support (`with_timeframe=true`), you can set `published_at_column` and `published_until_column` to define start/end dates. Use `filterByPublicationActive()` to query records within active timeframes.
Is there a way to exclude unpublished records by default in all queries?
Yes, set the `include_unpublished` parameter to `false` (default) in the behavior’s XML configuration. This ensures unpublished records are excluded unless explicitly included via `includeUnpublished()` in queries.
What are the risks of using this package in a Laravel project?
The package is archived, relies on abandoned Propel 1.x, and lacks Laravel-specific support. Risks include security vulnerabilities, compatibility issues with modern PHP/Laravel, and high maintenance burden if Propel breaks or deprecates.
How can I replicate this functionality in Laravel without Propel?
Use Eloquent’s `SoftDeletes` trait for soft-unpublishing, custom accessors for `isPublished()`, and query scopes (e.g., `scopePublished()`) to filter records. For timeframes, add `published_at`/`published_until` columns and scope logic.
Will this package work with Propel 2.x?
No, this package explicitly targets Propel 1.x and may not work with Propel 2.x due to breaking changes. Propel 2.x is also not widely adopted in Laravel ecosystems, making this a non-starter for most projects.
How do I handle unpublished records in API responses if I use this package?
Use the `includeUnpublished()` query method to fetch unpublished records when needed. For API responses, manually filter results or use the `hasPublicationStarted()`/`hasPublicationEnded()` methods to check publication status before serialization.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
bugban/symfony
beyonder-capi/workflow-extensions-bundle
beyonder-capi/job-queue-bundle
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin