Add (initial): futurewalker code
This commit is contained in:
@@ -9,12 +9,19 @@
|
||||
|
||||
class PublishIndexPostTask
|
||||
{
|
||||
public static function handle(Post $post)
|
||||
public static function handle(int $post_id)
|
||||
{
|
||||
$post->published_at = now();
|
||||
$post = Post::find($post_id);
|
||||
|
||||
if (is_null($post))
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
$post->status = 'publish';
|
||||
|
||||
if ($post->save()) {
|
||||
if (app()->environment() == 'production') {
|
||||
if ((app()->environment() == 'production') && (config('platform.global.indexing'))) {
|
||||
$post_url = route('front.post', ['slug' => $post->slug, 'category_slug' => $post->category->slug]);
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user