feat(cms): expose public document api and trigger site revalidation
This commit is contained in:
@@ -23,8 +23,20 @@ class SiteRevalidationService
|
||||
static::revalidate('page', $slug);
|
||||
}
|
||||
|
||||
/**
|
||||
* Revalidate document cache on the Next.js frontend.
|
||||
*/
|
||||
public static function revalidateDocument(?string $slug = null): void
|
||||
{
|
||||
static::revalidate('document', $slug);
|
||||
}
|
||||
|
||||
private static function revalidate(string $type, ?string $slug = null): void
|
||||
{
|
||||
if (app()->runningUnitTests()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$url = config('services.nextjs.revalidate_url');
|
||||
$token = config('services.nextjs.revalidate_token');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user