Unable to get Bake Console working and all answers are outdated

154 views Asked by At

I have a CakePHP project in

C:/xampp/htdocs/cms2

I'm trying to use bake console, but when I run "bin/cake" in the command prompt it says that 'bin' is not recognized as an internal or external command, operable program or batch file. I followed this and It got installed and I restarted my PC.

So, I 'cd' my way from the console to my project's directory and I type in composer require --dev cakephp/bake:"^2.0" for a second time just to make sure:

Console when I run the command

This means bake is installed, right? When I first ran this command, I had some files downloaded and installed, this picture is after running the command for a second time. I have PHP set up correctly in my Environment Variables. I've been doing my research and I still can't find my answer.

Things I've done:

  1. I followed this article here, but it lead to nowhere. I have no cake\console folder. This is what my File Explorer of my project looks like, so there's no cake/console enter image description here

  2. Then I followed this stackoverflow thread However it was for WAMP, so I couldn't find anything similar. When I search for "Console" in my project folder, I find about 30 "Console" files and folders. When I do php -v I get: PHP 7.3.27

  3. I follow this thread and I add C:\xampp\htdocs\cms2\bin to my "Path" System Environmental Variables, but still nothing happens.

I'm out of ideas and I don't know what I'm doing wrong. I need to bake my models and controllers and what not and I am unable. I also took a picture of my SYSTEM Environmental Variables, just in case it could help someone help me.

enter image description here

1

There are 1 answers

0
Subnom On

Seems like I was following the documentation in the cakePHP cookbook and they had it typed:

enter image description here

Turns out, I had to use

bin\cake bake model users