published_at = now(); if ($post->save()) { if (app()->environment() == 'production') { $post_url = route('front.post', ['slug' => $post->slug, 'category_slug' => $post->category->slug]); try { IndexNow::submit($post_url); } catch (Exception) { } try { LaravelGoogleIndexing::create()->update($post_url); } catch (Exception) { } } } } }