Reputation: 1077
here's the code
Route::get('run-cmd', function() {
Artisan::call('make:controller HelloController');
});
and I wonder I'm getting this error...
InvalidArgumentException in Application.php line 549:
Command "make:controller HelloController" is not defined.
Did you mean one of these?
make:migration
make:controller
make:middleware
make:request
make:provider
make:console
make:event
make:model
make:command
what's wrong?
Upvotes: 1
Views: 1804
Reputation: 2370
Replace
Artisan::call('make:controller HelloController');
with
Artisan::call('make:controller', [ 'name' => 'HelloController' ]);
Upvotes: 1