freshcrate
Skin:/

bake

The Bake Command Plugin

Why this rank:Strong adoptionRecent releaseHealthy release cadence

Description

The Bake Command Plugin

README

Bake plugin for CakePHP

Build Status Latest Stable VersionCoverage StatusLicenseThis project provides the code generation functionality for CakePHP. Through a suite of CLI tools, you can quickly and easily generate code for your application.

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

composer require --dev cakephp/bake

Documentation

You can find the documentation for bake on its own cookbook.

Testing

After installing dependencies with composer you can run tests with phpunit:

vendor/bin/phpunit

If your changes require changing the templates that bake uses, you can save time updating tests, by enabling bake's 'overwrite fixture feature'. This will let you re-generate the expected output files without having to manually edit each one:

UPDATE_TEST_COMPARISON_FILES=1 vendor/bin/phpunit

Release History

VersionChangesUrgencyDate
3.7.0## What's Changed * Allow using __d() in plugin context. by @dereuromark in https://github.com/cakephp/bake/pull/1039 * docs: Add Bake Enums section to usage documentation by @dereuromark in https://github.com/cakephp/bake/pull/1076 * add rector by @LordSimal in https://github.com/cakephp/bake/pull/1077 * Fix bakeTest() code example in documentation by @dereuromark in https://github.com/cakephp/bake/pull/1078 * convert docs to Vitepress by @LordSimal in https://github.com/cakephp/bake/pull/High5/31/2026
3.6.4## What's Changed * Skip new migrations tables by @LordSimal in https://github.com/cakephp/bake/pull/1084 * Fix command name. by @ADmad in https://github.com/cakephp/bake/pull/1082 **Full Changelog**: https://github.com/cakephp/bake/compare/3.6.3...3.6.4High5/8/2026
3.6.3## What's Changed * Fix singular/plural variable collision in baked templates - https://github.com/cakephp/bake/pull/1075 **Full Changelog**: https://github.com/cakephp/bake/compare/3.6.2...3.6.3Medium3/21/2026
3.6.2## What's Changed * Fix path check on Windows. by @ADmad in https://github.com/cakephp/bake/pull/1072 **Full Changelog**: https://github.com/cakephp/bake/compare/3.6.1...3.6.2Low2/13/2026
3.6.1## What's Changed * Fix checking references int non-foreign constraints by @othercorey in https://github.com/cakephp/bake/pull/1070 **Full Changelog**: https://github.com/cakephp/bake/compare/3.6.0...3.6.1Low2/13/2026
3.6.0## What's Changed * fix class only generate not working by @LordSimal in https://github.com/cakephp/bake/pull/1062 * Remove ID on related data. by @dereuromark in https://github.com/cakephp/bake/pull/1063 * Allow baking any class. by @dereuromark in https://github.com/cakephp/bake/pull/1064 * Update brick/varexporter version constraint by @dereuromark in https://github.com/cakephp/bake/pull/1067 * Add descriptive error messages for composite unique constraints by @dereuromark in https://gLow1/12/2026
3.5.1## What's Changed * Bump twig-view constraint by @josbeir in https://github.com/cakephp/bake/pull/1061 ## New Contributors * @josbeir made their first contribution in https://github.com/cakephp/bake/pull/1061 **Full Changelog**: https://github.com/cakephp/bake/compare/3.5.0...3.5.1Low10/22/2025
3.5.0## What's Changed * Fix up getDisplayField() in relation to Cake 6.0 by @dereuromark in https://github.com/cakephp/bake/pull/1037 * Ensure fallback class is enabled for the table locator. by @ADmad in https://github.com/cakephp/bake/pull/1047 * Fix up wrapper usage for io. by @dereuromark in https://github.com/cakephp/bake/pull/1045 * Consolidate links. by @dereuromark in https://github.com/cakephp/bake/pull/1048 * Update 2.x references to 3.x in Japanese documentation by @kobashi in httpLow10/5/2025
3.4.0## Improvements * Use link instead of uses to avoid PHPUnit clash. by @dereuromark in https://github.com/cakephp/bake/pull/1042 **Full Changelog**: https://github.com/cakephp/bake/compare/3.3.1...3.4.0Low7/3/2025
3.3.1## What's Changed * Fixed typo for login controller element by @mirko-pagliai in https://github.com/cakephp/bake/pull/1033 * Fix up fields command option. by @dereuromark in https://github.com/cakephp/bake/pull/1036 ## New Contributors * @mirko-pagliai made their first contribution in https://github.com/cakephp/bake/pull/1033 **Full Changelog**: https://github.com/cakephp/bake/compare/3.3.0...3.3.1Low5/13/2025
3.3.0## What's Changed * Add note to remove method hooks in generated template if not needed by @LordSimal in https://github.com/cakephp/bake/pull/1005 * Add `standalone-path` option for plugin commmand. by @ADmad in https://github.com/cakephp/bake/pull/1007 * Update CakePHP version in URLs by @ADmad in https://github.com/cakephp/bake/pull/1009 * Add getDescription() to command template by @ADmad in https://github.com/cakephp/bake/pull/1008 * Allow all --everything to run through using force mLow3/30/2025
3.2.3## What's Changed * Set the pseudo method to "delete" for "Delete" links. by @ADmad in https://github.com/cakephp/bake/pull/1028 * Set the name for baked commands by @ADmad in https://github.com/cakephp/bake/pull/1030 * Update brick/varexporter requirement from ^0.5.0 to ^0.6.0 **Full Changelog**: https://github.com/cakephp/bake/compare/3.2.2...3.2.3Low3/12/2025
3.2.2## What's Changed * Don't ask for plugin path again for a vendor plugin. by @ADmad in https://github.com/cakephp/bake/pull/1027 **Full Changelog**: https://github.com/cakephp/bake/compare/3.2.1...3.2.2Low1/17/2025
3.2.1## What's Changed * add note to remove method hooks in generated template if not needed by @LordSimal in https://github.com/cakephp/bake/pull/1005 * Add `standalone-path` option for plugin commmand. by @ADmad in https://github.com/cakephp/bake/pull/1007 * Update CakePHP version in URLs by @ADmad in https://github.com/cakephp/bake/pull/1009 * Add getDescription() to command template by @ADmad in https://github.com/cakephp/bake/pull/1008 * update stan by @LordSimal in https://github.com/cakepLow1/8/2025
3.2.0## What's Changed * Ignore vendor everywhere by @ravage84 in https://github.com/cakephp/bake/pull/984 * Correct asserted view code by @ravage84 in https://github.com/cakephp/bake/pull/986 * Improve enum generation by @markstory in https://github.com/cakephp/bake/pull/990 * Add a method to BakeHelper to check for other plugins. by @markstory in https://github.com/cakephp/bake/pull/992 * Detect Authorization plugin and include it in bake output by @markstory in https://github.com/cakephp/baLow9/14/2024
3.1.1## What's Changed * Add support and tests for enum comment. by @dereuromark in https://github.com/cakephp/bake/pull/978 * Fix up bake templates around array list by @dereuromark in https://github.com/cakephp/bake/pull/979 * fix: add singularAlias param on associations hasMany by @arodu in https://github.com/cakephp/bake/pull/980 * Fix up bake value defaults for fixtures with enums by @dereuromark in https://github.com/cakephp/bake/pull/982 ## New Contributors * @arodu made their first coLow3/11/2024
3.1.0## What's Changed * Allow baking enums. by @dereuromark in https://github.com/cakephp/bake/pull/968 * Bake table with enums mapped. by @dereuromark in https://github.com/cakephp/bake/pull/969 * Fix unique constraints getting lost. by @ndm2 in https://github.com/cakephp/bake/pull/967 * Complete baking of enums. by @dereuromark in https://github.com/cakephp/bake/pull/972 * PHP Parser v5 compatibility by @dereuromark in https://github.com/cakephp/bake/pull/975 **Full Changelog**: https:Low1/30/2024
3.0.6## What's Changed * Fix up phpunit.xml.dist.twig by @dereuromark in https://github.com/cakephp/bake/pull/973 * 3.x: stan update by @LordSimal in https://github.com/cakephp/bake/pull/974 **Full Changelog**: https://github.com/cakephp/bake/compare/3.0.5...3.0.6Low1/28/2024
3.0.5## What's Changed * No whitespace on closing tags by @dereuromark in https://github.com/cakephp/bake/pull/955 * 2.x to 3.x by @dereuromark in https://github.com/cakephp/bake/pull/960 * Run composer normalize over composer.json by @dereuromark in https://github.com/cakephp/bake/pull/964 * Bump actions/stale from 8 to 9 by @dependabot in https://github.com/cakephp/bake/pull/965 * 3.x - Fix fields being incorrectly detected as file fields. by @ndm2 in https://github.com/cakephp/bake/pull/966 Low12/24/2023
3.0.4## What's Changed * Fix annotation for entity field mapped to enum type - by @ADmad in https://github.com/cakephp/bake/pull/959 **Full Changelog**: https://github.com/cakephp/bake/compare/3.0.3...3.0.4Low11/3/2023
3.0.3## What's Changed * Fix signature for Table::get() annotation. by @ADmad in https://github.com/cakephp/bake/pull/945 * Fix config array type. by @dereuromark in https://github.com/cakephp/bake/pull/947 * Update annotation order by @cleptric in https://github.com/cakephp/bake/pull/949 * 3.x: adjust annotations by @LordSimal in https://github.com/cakephp/bake/pull/954 * 3.x - Widen the `@method` annotations to cover the actual return type. by @ndm2 in https://github.com/cakephp/bake/pull/956 Low11/1/2023
3.0.2## What's Changed * 3.x: change composer.json to cake5 stable version by @LordSimal in https://github.com/cakephp/bake/pull/937 * Try new dep by @dereuromark in https://github.com/cakephp/bake/pull/938 * Remove unneeded dev depenency by @ADmad in https://github.com/cakephp/bake/pull/940 * adjustments to make 3.x docs deploy work by @LordSimal in https://github.com/cakephp/bake/pull/941 * 3.x: adjust docs by @LordSimal in https://github.com/cakephp/bake/pull/942 * Use named arguments by @stLow9/17/2023
3.0.1* Update to stable dependencies. **Full Changelog**: https://github.com/cakephp/bake/compare/3.0.0...3.0.1Low9/10/2023
3.0.0First version compatible with CakePHP 5.0 ## What's Changed * Update for Cake 5. by @ADmad in https://github.com/cakephp/bake/pull/836 * update generated classes due to changes in milligram 1.4.1 by @LordSimal in https://github.com/cakephp/bake/pull/874 * 3.x: change baked index method to use query instance instead of table by @LordSimal in https://github.com/cakephp/bake/pull/878 * Cleanup of signature docs by @dereuromark in https://github.com/cakephp/bake/pull/902 * Fixes applicatioLow9/10/2023
2.9.3## What's Changed * Add `allow-alias-relations` option to bake model command by @passchn in https://github.com/cakephp/bake/pull/913 ## New Contributors * @passchn made their first contribution in https://github.com/cakephp/bake/pull/913 **Full Changelog**: https://github.com/cakephp/bake/compare/2.8.3...2.9.3Low3/31/2023
2.8.3## What's Changed * Fix stan errors - by @ADmad in https://github.com/cakephp/bake/pull/901 * Fix error when trying to bake with non-existent plugins directory - by @ADmad in https://github.com/cakephp/bake/pull/911 ## New Contributors * @angelxmoreno made their first contribution in https://github.com/cakephp/bake/pull/876 **Full Changelog**: https://github.com/cakephp/bake/compare/2.8.2...2.8.3Low3/10/2023
2.8.2## What's Changed * Update regex for finding bake template files. by @ADmad in https://github.com/cakephp/bake/pull/871 * Add support for keeping custom class implements with --update by @othercorey in https://github.com/cakephp/bake/pull/873 **Full Changelog**: https://github.com/cakephp/bake/compare/2.8.1...2.8.2Low10/5/2022
2.8.1## What's Changed * Fix twig error baking component by @othercorey in https://github.com/cakephp/bake/pull/870 **Full Changelog**: https://github.com/cakephp/bake/compare/2.8.0...2.8.1Low9/26/2022
2.8.0## Changes * Support for keeping app-specific functions, properties and constants in model file with the new `--update` option for `bake model` * All generated code will still be overwritten * Support for customizing file headers with the new `Bake.file_header` element * Detecting and generating `HasOne` associations * Customizing template renderer View options using the new `Bake.renderer` event or `BakeCommand::createTemplateRenderer()` * Don't enforce FKs presence on create to alLow9/24/2022
2.8.0-RC1## What's Changed ### Non-destructive baking for Entity and Table The model command now supports a new `--update` option which tries to update only the generated code in entity and tables files. Updating will keep any user-specific class member functions, properties and constants while updating all generated code. However, any user-specific code within generated functions, functions and constants will be over-written. ### Generating HasOne associations HasOne associations are nowLow9/18/2022
2.7.2## What's Changed * Use generic syntax by @dereuromark in https://github.com/cakephp/bake/pull/846 * Fix wrong connection used when detecting belongsTo associations by @othercorey in https://github.com/cakephp/bake/pull/866 **Full Changelog**: https://github.com/cakephp/bake/compare/2.7.1...2.7.2Low9/18/2022
2.7.1## What's Changed * Fix class not found in plugin test by @nishimura-d in https://github.com/cakephp/bake/pull/823 * Update GitHub actions by @dependabot in https://github.com/cakephp/bake/pull/824, https://github.com/cakephp/bake/pull/825 and https://github.com/cakephp/bake/pull/826 * Update phpstan and psalm by @LordSimal in https://github.com/cakephp/bake/pull/829 * Remove invalid @param by @othercorey in https://github.com/cakephp/bake/pull/832 * Avoid generating association if table Low7/27/2022
2.7.0## What's Changed * Fix up templates for generics in docblocks, more precise assoc def. by @dereuromark in https://github.com/cakephp/bake/pull/792 * fix multiple test run issue by @GrandFelix in https://github.com/cakephp/bake/pull/794 * Fix PHP 8.1 shell helper fatal error by @LordSimal in https://github.com/cakephp/bake/pull/799 * fix --quiet option not being quiet by @LordSimal in https://github.com/cakephp/bake/pull/800 * Add missing docblock param, add assoc doc. by @dereuromark in htLow4/15/2022
2.6.1## Changes * Fixed baking columns that start with an underscore `_`.Low11/1/2021
2.6.0## New Features * Requires CakePHP 4.3.0+ * Update plugin creation for 4.3 by @markstory in https://github.com/cakephp/bake/pull/757 * Add `CommandHelper` bake command by @mentisy in https://github.com/cakephp/bake/pull/763 * Full french doc update by @zachee54 in https://github.com/cakephp/bake/pull/764 * Add stub for console() to bake templates by @rkaiser0324 in https://github.com/cakephp/bake/pull/769 * Add support for phpunit 9 by @othercorey in https://github.com/cakephp/bake/pull/Low10/24/2021
2.5.2* Improve doc blocks in generated code for tests. * Improve doc blocks in generated code for templates.Low7/27/2021
2.5.1Changes ------------ Update use of deprecated method. #752Low4/30/2021
2.5.0Changes ------------ - Add new helper method for exporting vars. #751. If you are have extended bake's commands in your app/plugin and are modifying the array(s) which were consumed by `BakeHelper::stringifyList()` in the templates then you might have to update your code as per changes in the linked PR.Low4/28/2021
2.4.1Fixes ------- - Fix package version constraint being HTML encoded in baked composer.json for plugins. #748Low4/23/2021
2.4.0Fixes ------ * Added the `--theme` and `--force` options to `bake plugin`. * Improved warning generation in `bake model`. * Improved Japanese documentation. * Improved documentation on plugin override templates. Removals ---------- * Removed commands to generate shells/tasks. These class types have been long deprecated in CakePHP.Low4/21/2021
2.3.0Added ------- * Bake now prefers commands located in the `Command\Bake`. If your plugin or application has this namespace and directory only commands from that directory will be detected as bake commands. Fixes ----- * Improved documentation and recommend using the `Command\Bake` namespace.Low11/25/2020
2.2.1Fixes ------- * Updated TwigView requirement. * Moved CI to GitHub Actions. * Fixed missing TimestampTimezone field type support.Low11/14/2020
2.2.0Added --------- * The `--prefix` opt was added to `bake all`. * Custom datatype classes now generate fixtures using the `string` type. Fixes ------- * Used assertSame where possible in the test suite. * Fixed event name for view templates with / in them. * Improve documentation.Low10/23/2020
2.1.2## Fixes - Simplified autoload path. - Removed usage of TableRegistry from bake internals. - Updated documentation. - Fixed commands not removing `.gitkeep` files. - Fixed application template overrides having bake in the path name twice. ## Breaking Changes - The path for template overrides in applications changed to **/templates/plugins/Bake**. This an undocumented side-effect from the previous release. Paths for overrides in theme plugins remain the same.Low8/3/2020
2.1.1### Fixes - Fixed typehints in baked code. - Use the Bake plugin prefix instead of manipulating the global paths. - Minor improvements in bake templates. Low5/10/2020
2.1.0We have switched to the official Twig integration plugin - [cakephp/twig-view](https://github.com/cakephp/twig-view). Check out the [twig-view release notes](https://github.com/cakephp/twig-view/releases) to see what's new! ### Upgrading - For users that do not use TwigView directly in their application, you don't need to change anything. - For users that have a direct dependency on the previous plugin, wyrihaximus/twig-view, you must remove that package before upgrading to Bake 2.1Low4/18/2020
2.0.10### Fixes - Use `templates/bake` instead of `src/Template/Bake` when building theme choices. - Removed unnecessary `cakephp/plugin-installer` dependency.Low4/18/2020
2.0.9### Fixes * Add constructor argument to generated tests for behaviors. * Fixed links in readme.Low4/10/2020
2.0.8### Fixes * TableScanner now supports regex patterns for ignoring tables. This allows it to ignore phinxlog tables in plugins.Low4/5/2020
2.0.7### Fixes * `controller` command now uses `AppController` base classes in plugins if they exist. * Improved return type hinting of commands and fixed internal strict type lint errors.Low3/24/2020
2.0.6### Fixes * Commands supporting the `--force` flag now honour it. * Generated tests for controllers no longer include a `testInitialization()` method. * Improved doc block typehints for controllers. * Controllers with`$modelClass = ''` can have tests generated for them.Low3/17/2020
2.0.5### Fixes * Update to not use deprecated File and Folder classes. * Fix plugin command when there is more than one plugin path. * Improve fixture generation for `timestampfractional` type. * Improved method annotations in generated table classes.Low2/20/2020

Dependencies & License Audit

Loading dependencies...

Similar Packages

slot-jsx-pragma🎰 Enable declarative slottable components with a custom JSX pragma for seamless React integration and enhanced performance.main@2026-06-06
alefGenerate fully-typed, lint-clean language bindings for Rust libraries across 11 languagesv0.23.18
local-ai-devenv🤖 Automate coding, testing, and deployment with a local AI environment powered by a team of intelligent agents.main@2026-06-06
ai-dataset-generator🤖 Generate tailored AI training datasets quickly and easily, transforming your domain knowledge into essential training data for model fine-tuning.main@2026-06-06
dopEffectCSharp🚀 Maximize your C# productivity with advanced techniques in strings, LINQ, and clean code, inspired by the book "Produtivo com C#."master@2026-06-06

More in Uncategorized

llama.cppLLM inference in C/C++
modal-clientSDK libraries for Modal
anolisaANOLISA - Agentic Nexus Operating Layer & Interface System Architecture