Skip to content
Discussion options

You must be logged in to vote

So for those who having with this one this is how I solved it.

So I created a command with a handle with something like this.

// this is sample handle from the command which can
// be found in app\Console\Commands after creating command `php artisan make:command <name>`

...
public function handle() {
       (new ExampleClassHere())->sampleFunctionHere();
}
...

and in that class

// we need to extend our commands this way we
// can use $this->info,$this->line() etc. to write console output
use Illuminate\Console\Command; 
use Symfony\Component\Console\Helper\ProgressBar;

class ExampleClassHere extends Command {
    public function __construct()
    {
        parent::__construct();
        /…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@JenuelDev
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by JenuelDev
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants