for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Thinktomorrow\Chief\States\Publishable;
class PreviewMode
{
private $active;
public function __construct(bool $active)
$this->active = $active;
}
public static function fromRequest()
$active = (request()->has('preview-mode') && auth()->guard('chief')->check());
return new static($active);
public function check(): bool
return $this->active;