I want a share that I created and saved in the database to be activated from passive on a certain date. I couldn’t find the most correct way to do this.
How should I code this?
>Solution :
Set a date in a ‘publish_at’ column on the database.
When you query the database to show items, you can include a where statement so that only items that are publish_at in the past are displayed.
For instance, if this were a Post model;
$posts = Post::where('publish_at', '<', now())->get();