0

I'm currently developing a simple composer package for a laravel application. The package contains 5 php files and as soon as it gets installed these files should be copied in a new folder inside of the laravel app.

To do so I created a new command which should run the moveFiles function but I guess I didn't configure it correctly - when I try to run it I get - Command "move-files" is not defined. Please help!

ServiceProvider class:

class ThemeServiceProvider extends ServiceProvider {

protected $commands = ['mysteryreloaded\copytheme\Commands\MoveFiles'];

public function boot() {

}

public function register() {
    $this->commands($this->commands);
}
}

Command class:

class MoveFiles extends Command {
protected $signature = 'move-files';

public function handle() {
    $this->info(FilePacker::move());
}
}
themystery
  • 43
  • 1
  • 1
  • 6
  • Did you set up as well the service discovery for you package? If not did you registered you package's service provider into your app? You can read more in the [documentation](https://laravel.com/docs/5.8/packages#package-discovery) – mdexp Sep 14 '19 at 00:08
  • Inside boot method in your package you can define publish methods to copy files, see Laravel docs here https://laravel.com/docs/5.7/packages#publishing-file-groups – Luis de Brito Sep 14 '19 at 03:18

0 Answers0