- What is awcodes/focus used for?
- Focus generates documentation screenshots and share cards for Laravel Workbench applications using Playwright. You declare the images you need through a manifest API built around ScreenshotSuite, Screenshot, and Card, then run the CLI to render them. It is build-time tooling for docs and artwork, not a runtime package for your application.
- Is awcodes/focus the Filament focus mode plugin?
- No. The package blurb describes a Filament panel focus mode UI, but the repository description, release notes, and docs describe a Playwright screenshot generator for Laravel Workbench apps. Treat the screenshot generator as the actual artifact and confirm package identity before adopting it. If you need a Filament focus mode UI, this is not the package to install.
- How do I install awcodes/focus in a Laravel project?
- Install it as a dev dependency with Composer, for example composer require --dev awcodes/focus. The 1.0 release requires PHP 8.3 or newer, so check your CI matrix before bumping. The non-PHP prerequisite is a headless Chromium runtime plus a defined font set on the machine that executes the CLI.
- How do I configure which screenshots and share cards Focus generates?
- Configuration is declarative: you define a ScreenshotSuite containing Screenshot and Card entries rather than scripting pixel capture directly. ScreenshotSuite::plan() is the internal planning step behind that manifest, so keep your own code on the public manifest types. This keeps reviews about declared assets instead of diffed images.
- Does Focus work with Laravel Workbench packages?
- Yes. Focus is aimed at generating screenshots from Laravel Workbench applications, which fits package documentation and release artwork. It runs as a build-time CLI against the Workbench app, not inside a normal Laravel request cycle. That makes it suitable for package maintainers documenting components and UI states.
- Which PHP and Laravel versions does awcodes/focus support?
- The 1.0 release has a PHP 8.3 floor, which is the main upgrade-blocking change from 0.3. Laravel version constraints should be checked in the package composer.json before adoption, because the available context does not list them. Because Focus is not a runtime dependency, Laravel compatibility mostly affects the Workbench app you render.
- Can I run Focus in CI as a screenshot gate?
- Yes. The 1.0 semver promise covers commands, options, exit codes, and output filenames, so the CLI can act as a pass/fail CI step. That is the main operational advantage over a manual screenshot chore. Pair it with one nominated reference render host to limit pixel drift.
- Why are Focus screenshots different on another machine?
- Chromium is not pinned to a Focus release, and browser or OS font updates can change rendered pixels. The maintainers treat this as acknowledged behaviour rather than a bug awaiting a patch. Generate a repository's images on one documented reference host and do not promise cross-environment pixel determinism.
- Should awcodes/focus be a production dependency?
- No. It belongs in require-dev alongside static analysis and test tooling because its failure domain is the documentation and artwork pipeline, never a production request path. A failure blocks regenerating images, not shipping code. If you prefer not to adopt a manifest tool, direct Playwright scripts are the obvious alternative.
- What parts of the Focus API are stable, and how should I upgrade?
- ScreenshotSuite, Screenshot, and Card form the durable manifest API. Runtime, Manifest, Console, Capture, and ScreenshotSuite::plan() are marked internal and may change in any release, so grep for those namespaces before a dependency bump. Upgrades that change output defaults require a major release, but pixel output can still vary by render host.