adamgoose/prismic-io
A Laravel integration for the Prismic.io headless CMS, offering a convenient API client and facade for querying Prismic documents, managing content repositories, and working with CMS responses in PHP applications.
composer require adamgoose/prismic-io:1.3.*. This package predates Laravel package auto-discovery, so nothing happens until you register it yourself.app/config/app.php under providers, and the facade (if one is shipped) under aliases. Run composer dump-autoload afterwards; a missing alias entry is the most common cause of a confusing "Class not found" on first boot.php artisan config:publish adamgoose/prismic-io (4.2 path) — the file lands under app/config/packages/adamgoose/prismic-io/. Put your Prismic API endpoint and access token there, or in .env if the package's config reads it.register() first. That is where the Prismic client is bound into the container and where the config keys are actually consumed; the README quick-start is secondary. The provider tells you the binding name you will type-hint and inject everywhere else.php artisan tinker, resolve the client from the container (App::make('...')), and run a single read against a known document type before touching a controller. That one step validates credentials, config publishing, and container bindings simultaneously — if the query returns a document, your integration is live.handle() methods. Reserve the facade alias for Blade templates and tinker. This is what makes the rest of these patterns possible.ContentRepository / PrismicGateway class that owns the client and exposes domain-shaped methods (getHomepage(), getArticleBySlug($slug), getLatestPosts($limit)). Every view and controller talks to that class, never to the Prismic client directly. When Prismic's API shifts — or when you eventually replace this package — you change one file.Prismic\Fragment\* instances, otherwise every template becomes coupled to the CMS SDK.master ref advances every time an editor publishes. Fetch the master ref once (the package/client supports this) and pass it into queries rather than relying on an implicit default — this is also the hook you need for release previews and previews of unpublished drafts.page/pageSize from your gateway and return the total so the controller can build pagination links. Do not loop until exhausted inside a request.handle(), not a long-lived object holding a stale config from before the deploy.setUp() via App::bind(). Because your views depend on the gateway's plain arrays rather than the SDK, the vast majority of your feature tests never need to know Prismic exists.composer.json for the illuminate/support constraint before planning anything — if it's 4.2.*, this will not install on a modern Laravel without a maintained fork, and forking means you now own the whole package. Confirm that up front; it determines whether the rest of this document applies at all.git diff <previous-tag>..1.3 and scan for changed defaults, changed return shapes, or changed exception types before upgrading production. With no detail available, treat the release as unaudited and lean on a smoke test.php artisan config:clear where available, or delete the cached file) and re-run the smoke test. On 4.2 the config lives under app/config/packages/...; do not edit the file inside vendor/.App::extend() to decorate the existing resolution. Vendor edits vanish on the next composer update and make patch upgrades hazardous.get_class(App::make('...')) to confirm you are hitting the implementation you think you are; container overrides that don't take effect are almost always a provider ordering problem.How can I help you explore Laravel packages today?