0

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

Subnom
  • 57
  • 2
  • 11
  • 2
    One word, "_backslash_". – ndm Apr 01 '21 at 18:27
  • I don't get it, where do I look at? – Subnom Apr 01 '21 at 18:52
  • 2
    `bin/cake` contains a _forward_ slash. – ndm Apr 01 '21 at 19:32
  • 1
    @Sibuscus https://stackoverflow.com/a/51607322/1127933 – Salines Apr 01 '21 at 20:36
  • Oh, wow, nice, are you serious? I literally wasted a whole day yesterday trying to figure everything out, reinstalling literally every program I used. Who would've taught that the cake cookbook had it wrong? This command is literally from their cookbook: bin/cake bake model users – Subnom Apr 02 '21 at 13:33
  • @Sibuscus the bin is not the command, but the folder where the cake command is located. – Salines Apr 02 '21 at 14:43
  • There's actually a note for Windows CMD users ;) https://book.cakephp.org/bake/2/en/usage.html – ndm Apr 02 '21 at 16:37

1 Answers1

0

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
Subnom
  • 57
  • 2
  • 11