lemaur/eloquent-publishing
Add publishing support to Laravel Eloquent models with a simple trait. Manage publish dates, query scopes and helpers, plus custom migration blueprint methods to quickly add publishing columns and build publishable content workflows.
Pros:
whereNotNull handling in Eloquent 11).ShouldQueue improvements).Cons:
Model::newQueryWithoutScopes()) may interact differently with query scopes.laravel/framework), and PHP extensions (e.g., pdo_mysql).ext-intl, ext-mbstring).published_at) may need review for Laravel 11’s query optimizer.Critical Risks:
App\Providers\AppServiceProvider differently (e.g., boot() → register()).Route::macro() behavior may change.create_function(), dynamic properties (if used in custom logic).QueryBuilder may optimize scopes differently (test onlyPublished() performance).Illuminate\Events\Dispatcher under the hood; ensure custom listeners are compatible.Mitigation Strategies:
laravel-upgrade tool to automate dependency updates:
composer require --dev laravel/upgrade-tool && vendor/bin/laravel-upgrade --target=11.x
3.3.x if critical issues arise (but lose security updates).3.3.x a viable long-term option?spatie/laravel-permission) that block Laravel 11 upgrades?onlyPublished() and latestPlanned() perform under Laravel 11’s query builder? (Test with DB::enableQueryLog().)lemaur/eloquent-publishing:3.3.0.)Model::newQuery(), Route::macro changes).composer why-not laravel/framework 11.x to identify blocking dependencies.composer.json for PHP 8.2+ compatibility (e.g., ext-json version).composer.json:
"require": {
"laravel/framework": "^11.0",
"php": "^8.2"
},
"lemaur/eloquent-publishing": "^4.0"
composer update and resolve conflicts.APP_URL, SESSION_DOMAIN) if using new defaults.use LeMaur\EloquentPublishing\Publishes;
class Post extends Model {
use Publishes;
}
Post, Product).onlyPublished() and latestPlanned() work as expected.RouteServiceProvider → Route::macro (affects custom route logic).HasFactory trait changes (if using custom factories).Artisan::call() behavior (if used in custom commands).whereNotNull in query scopes.enum PublishStatus).create_function(), call_user_func_array() with variadic args.Schema builder may handle published_at indexes differently; verify with php artisan schema:dump.BlogPost).published_at columns.How can I help you explore Laravel packages today?