Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Bakery

Laravel Bakery Laravel Package

scrnhq/laravel-bakery

Laravel Bakery automatically generates model factories for your Laravel app by inspecting your database schema. It saves time setting up test data, infers column types and relationships, and lets you bake accurate factories with a simple Artisan command—ideal for testing and seeding.

View on GitHub
Deep Wiki
Context7

🍞🧑‍🍳 An on-the-fly GraphQL Schema generator from Eloquent models for Laravel.

Frequently asked questions about Laravel Bakery
What is scrnhq/laravel-bakery used for?
Laravel Bakery is a Composer package that generates GraphQL schemas from Eloquent models on the fly for Laravel applications. Its documented purpose is GraphQL schema generation from your model layer, not primarily model factory generation despite any factory-related wording you may see. It is positioned as an accelerator for read-heavy internal APIs, admin panels, prototypes, and teams that want a GraphQL layer without hand-writing SDL first. The TPM assessment recommends treating it as a short proof of concept rather than a strategic, long-term GraphQL contract.
How do I install laravel-bakery in a Laravel project?
Install it with Composer from the scrnhq/laravel-bakery package and wire its Laravel service provider through the package's documented integration path. The TPM guidance recommends installing it in a branch, generating schemas for two or three representative models, and validating the resulting GraphQL contract before broader adoption. Run Composer dependency resolution against your actual application, not a clean Laravel skeleton, because transitive GraphQL dependencies can conflict.
Which Laravel and PHP versions are supported by laravel-bakery?
The context does not list explicit Laravel or PHP version constraints, and the last release was December 2021, so current compatibility is uncertain. Pin Laravel, PHP, and GraphQL dependency versions in a proof of concept and test against your target application's lockfile. Add a compatibility test matrix and be prepared to patch or fork if the package blocks Laravel upgrades.
Does laravel-bakery work with Lighthouse or webonyx/graphql-php?
The TPM assessment flags this as an open question: confirm whether Bakery depends on, complements, or conflicts with Lighthouse, webonyx/graphql-php, or your existing GraphQL layer. Do not add multiple schema generators to the same application without a clear integration test. If you already run Lighthouse, evaluate whether Bakery's generated schema can sit behind reviewed configuration or whether it duplicates existing behavior.
How does laravel-bakery handle authorization and field exposure?
Authorization is a primary adoption risk because automatic schema generation can expose model fields and relationships unintentionally. The TPM guidance requires a security review for field- and relationship-level authorization, plus reviewed configuration around the generated schema. Do not expose the endpoint to untrusted consumers until you have verified that missing field-level authorization and accidental relationship exposure are addressed.
Is the laravel-bakery generated schema deterministic and diffable?
The TPM assessment explicitly asks whether schema generation is deterministic, cacheable, and diffable, which matters for review and CI. Treat non-deterministic or hard-to-review generated schemas as a risk and test repeated generation against the same models. If output is stable, you can commit or cache the generated SDL and review changes like any other API contract.
How do I prevent N+1 queries with laravel-bakery GraphQL schemas?
GraphQL flexibility can create N+1 and query-complexity problems, so enforce depth and cost limits, pagination caps, batching or data-loader patterns, caching, and database indexes. Baseline query performance during the proof of concept and validate generated queries against production-like data volumes before expanding usage. The TPM assessment calls out N+1 behavior as a specific technical risk for this package.
Is laravel-bakery maintained and safe for production?
The package is MIT-licensed but has a stale release history, with the last release in December 2021 and a small community, so expect to own maintenance. Upstream support is likely community-only; require internal documentation, runbooks, schema ownership, and a named maintainer. Use it as an accelerator with an explicit exit plan rather than a long-term strategic dependency.
Can I use laravel-bakery for a public or versioned GraphQL API?
The TPM assessment says Bakery is a weak fit for public or versioned APIs, domain-driven designs with explicit contracts, polyglot service estates, and organizations requiring schema-first governance. It is better suited to internal tools, admin panels, prototypes, and read-heavy APIs where Eloquent is the authoritative data layer. For public contracts, consider hand-written SDL or a maintained schema-first GraphQL stack.
What is the exit path if laravel-bakery is abandoned or breaks?
Preserve the generated SDL as a starting point and be ready to migrate execution to a maintained GraphQL runtime such as Lighthouse or webonyx/graphql-php. The TPM guidance recommends a fork/upstream policy, dependency patch budget, and Laravel upgrade testing if you adopt the package. Decide early whether to adopt, fork, wrap generated SDL, or replace it with a maintained stack.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource