-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schedule post feature does not work #20
Comments
To resolve this issue, add the following code to your form in the DateTimePicker::make('published_at')
->visible(function ($get) {
return $get('status') === PostStatus::PUBLISHED->value;
})
->required(function ($get) {
return $get('status') === PostStatus::PUBLISHED->value;
})
->native(false);
Toggle::make('is_published')
->label('Published')
->default(false)
->required(function ($get) {
return $get('status') === PostStatus::PUBLISHED->value;
}); The complete code should be as follows: Fieldset::make('Status')
->schema([
ToggleButtons::make('status')
->live()
->inline()
->options(PostStatus::class)
->required(),
DateTimePicker::make('scheduled_for')
->visible(function ($get) {
return $get('status') === PostStatus::SCHEDULED->value;
})
->required(function ($get) {
return $get('status') === PostStatus::SCHEDULED->value;
})
->native(false),
DateTimePicker::make('published_at')
->visible(function ($get) {
return $get('status') === PostStatus::PUBLISHED->value;
})
->required(function ($get) {
return $get('status') === PostStatus::PUBLISHED->value;
})
->native(false),
]);
Toggle::make('is_published')
->label('Published')
->default(false)
->required(function ($get) {
return $get('status') === PostStatus::PUBLISHED->value;
});
|
Hello @edeoliv, Thanks for the reply. I've followed the installation steps for the blog plugin, but I haven't created a Post model in my project yet. The installation guide doesn't mention creating a Post model. Do I need to create a Post model and use your code to enable auto-publish scheduled blog? I'm looking forward to your response. A detailed answer with an example would help me a lot. https://filamentphp.com/plugins/firefly-blog#installation Awaiting your reply. Best Regards |
You must add the code in the |
Hey @edeoliv, Thank you for your prompt response. I implemented your pull request (PR) in my local project and incorporated all the changes you made. While doing so, I encountered a missing import error: use Filament\Forms\Components\Toggle; I added the missing import, and the new field was successfully added along with a publish tab. However, I noticed that the auto-publishing(Schedule post) feature for posts on a future date is not working as expected. The new date field doesn't seem to be functioning, and the publish switch also appears to be non-operational. I have added an screen recoding for your reference: Please me know if I am doing something wrong or there is some extra step to make it work. |
@alokVishu In current implementation of post scheduling feature, we have used laravel queue. This plugin dispatches the schedule action to queue. You need to setup queue worker in your application. Firefly\FilamentBlog\Resources\PostResource\Pages\CreatePost
You can visit laravel official documentation to get more information about how queue works. https://laravel.com/docs/11.x/queues#main-content This information about schedule feature should have been included in the documentation, we will add soon. |
Hello @sagautam5, I also would like to use the post scheduling feature but I'm having difficulty understanding how to do so. ~Best Regards |
Hello @sagautam5, |
Hello,
I attempted to use the schedule post feature, but it doesn't seem to be working. I followed the installation steps and tried to schedule the post, but it's not working. Are there any special steps I need to follow?
I can schedule the post but it's not get published when time meets.
Thank you for your time.
The text was updated successfully, but these errors were encountered: