Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vincej's avatar
Level 15

The only way I can make a standard l4 command work is by commenting out the Artisan::add(new SeedCommand);

bestmomo's avatar

Oh needs a big A ! That's the facade :

Artisan::add(new SeedCommand);
vincej's avatar
Level 15

ok well with a Big "A" I know get:

vince@vince-XPS-8300 /var/www/auburntree $ Artisan::add(new SeedCommand);
bash: syntax error near unexpected token `new'
vincej's avatar
Level 15

I have a big A in app/start/artisan.php I have had it all along:

Artisan::add(new SeedCommand);
bestmomo's avatar

app/commands is the normal place to put command class, I dont understand why it doesn't find it...

vincej's avatar
Level 15

Interesting - I ran dump-autoload and I got:

Generating autoload files



  [RuntimeException]                                                                                
  Could not scan for classes inside "app/commands" which does not appear to be a file nor a folder  

vincej's avatar
Level 15

Ok - Maybe I have it - I have not included it on the PSR-4

is that it ?

bestmomo's avatar

Because you have "Commands" and not "commands" in your directories

vincej's avatar
Level 15

Ok - autoload ran without error, however when I run the command in a terminal I still get:

vince@vince-XPS-8300 ~ $ Artisan::add(new SeedCommand);
bash: syntax error near unexpected token `new'
bestmomo's avatar

You dont have to run this command in a terminal. Just now check with php artisan list

vincej's avatar
Level 15
vince@vince-XPS-8300 ~ $ php artisan list
Could not open input file: artisan
vincej's avatar
Level 15

yes - php artisan works so long as I comment out the: Artisan::add(new SeedCommand);

If I do not comment it out then the whole of the L4 code appears in the terminal

That is significant

bestmomo's avatar

artisan.php is a casual php file with <?php ?

vincej's avatar
Level 15

I don't understand what you mean by that last statement. Yes, artisan.php has php tags

vincej's avatar
Level 15

I need to go out in a couple of minutes, my wife is giving me shit. And it is 12.30 AM for you .. so maybe a fresh head will solve the problem ? I feel we are very very close.

bashy's avatar

Haha you two, 4 pages :D

bestmomo, make a package!

vincej's avatar
Level 15

A package sounds great. Bestmomo has done a great job of trying to get it to work and I have been happy to be his first guinea pig ! :o)

bashy's avatar

Na, have stuff to manage migrations/seeds easier. Maybe a package that is like Jeffrey's generators but allows you to get all the tables into seed files and other cool stuff :P

vincej's avatar
Level 15

@bestmomo Many thanks for all your efforts in trying to get this to work ! It is much appreciated ! Did you ever get it working on L4.2 ?

I have not yet covered Jeffrey's lessons on building commands and so until I have covered that I will have to leave this project dormant for a while.

vincej's avatar
Level 15

Brilliant Thanks ! Did you make any changes since yesterday ??

Please or to participate in this conversation.