while run cron with lumen : There are no commands defined in the “insert” namespace.











up vote
0
down vote

favorite












I have written code for cron command as below in lumen (micro framwork of laravel)



<?php

namespace AppConsoleCommands;

use IlluminateConsoleCommand;
use AppModelsEmailDump;
use DB;

/**
* dumpEmails Class
*
* This cron is to dump emails with cron use
*
* @author Hetal Gohel <hetal.gohel@brainvire.com>
*
*/

class dumpEmails extends Command {

/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'insert:emails';

/**
* The console command description.
*
* @var string
*/
protected $description = 'This cron is to dump emails with cron use';

/**
* Create a new command instance.
*
* @return void
*/

public function __construct()
{
parent::__construct();
}

/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
echo "1";die;
}
}


in kernel file defined as below,



<?php

namespace AppConsole;

use IlluminateConsoleSchedulingSchedule;
use LaravelLumenConsoleKernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
LaravelistaLumenVendorPublishVendorPublishCommand::class,
'AppConsoleCommandsdumpEmails',
];

/**
* Define the application's command schedule.
*
* @param IlluminateConsoleSchedulingSchedule $schedule
* @return void
*/
// protected function schedule(Schedule $schedule)
// {
// return $schedule;
// }
}


I have fired command from console as below,



php artisan insert:emails


while run this command getting error as below,



[SymfonyComponentConsoleExceptionCommandNotFoundException] ←[39;49m
←[37;41m There are no commands defined in the "insert" namespace.



please help me to resolve this issue.thank you.










share|improve this question


























    up vote
    0
    down vote

    favorite












    I have written code for cron command as below in lumen (micro framwork of laravel)



    <?php

    namespace AppConsoleCommands;

    use IlluminateConsoleCommand;
    use AppModelsEmailDump;
    use DB;

    /**
    * dumpEmails Class
    *
    * This cron is to dump emails with cron use
    *
    * @author Hetal Gohel <hetal.gohel@brainvire.com>
    *
    */

    class dumpEmails extends Command {

    /**
    * The name and signature of the console command.
    *
    * @var string
    */
    protected $signature = 'insert:emails';

    /**
    * The console command description.
    *
    * @var string
    */
    protected $description = 'This cron is to dump emails with cron use';

    /**
    * Create a new command instance.
    *
    * @return void
    */

    public function __construct()
    {
    parent::__construct();
    }

    /**
    * Execute the console command.
    *
    * @return mixed
    */
    public function handle()
    {
    echo "1";die;
    }
    }


    in kernel file defined as below,



    <?php

    namespace AppConsole;

    use IlluminateConsoleSchedulingSchedule;
    use LaravelLumenConsoleKernel as ConsoleKernel;

    class Kernel extends ConsoleKernel
    {
    /**
    * The Artisan commands provided by your application.
    *
    * @var array
    */
    protected $commands = [
    LaravelistaLumenVendorPublishVendorPublishCommand::class,
    'AppConsoleCommandsdumpEmails',
    ];

    /**
    * Define the application's command schedule.
    *
    * @param IlluminateConsoleSchedulingSchedule $schedule
    * @return void
    */
    // protected function schedule(Schedule $schedule)
    // {
    // return $schedule;
    // }
    }


    I have fired command from console as below,



    php artisan insert:emails


    while run this command getting error as below,



    [SymfonyComponentConsoleExceptionCommandNotFoundException] ←[39;49m
    ←[37;41m There are no commands defined in the "insert" namespace.



    please help me to resolve this issue.thank you.










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have written code for cron command as below in lumen (micro framwork of laravel)



      <?php

      namespace AppConsoleCommands;

      use IlluminateConsoleCommand;
      use AppModelsEmailDump;
      use DB;

      /**
      * dumpEmails Class
      *
      * This cron is to dump emails with cron use
      *
      * @author Hetal Gohel <hetal.gohel@brainvire.com>
      *
      */

      class dumpEmails extends Command {

      /**
      * The name and signature of the console command.
      *
      * @var string
      */
      protected $signature = 'insert:emails';

      /**
      * The console command description.
      *
      * @var string
      */
      protected $description = 'This cron is to dump emails with cron use';

      /**
      * Create a new command instance.
      *
      * @return void
      */

      public function __construct()
      {
      parent::__construct();
      }

      /**
      * Execute the console command.
      *
      * @return mixed
      */
      public function handle()
      {
      echo "1";die;
      }
      }


      in kernel file defined as below,



      <?php

      namespace AppConsole;

      use IlluminateConsoleSchedulingSchedule;
      use LaravelLumenConsoleKernel as ConsoleKernel;

      class Kernel extends ConsoleKernel
      {
      /**
      * The Artisan commands provided by your application.
      *
      * @var array
      */
      protected $commands = [
      LaravelistaLumenVendorPublishVendorPublishCommand::class,
      'AppConsoleCommandsdumpEmails',
      ];

      /**
      * Define the application's command schedule.
      *
      * @param IlluminateConsoleSchedulingSchedule $schedule
      * @return void
      */
      // protected function schedule(Schedule $schedule)
      // {
      // return $schedule;
      // }
      }


      I have fired command from console as below,



      php artisan insert:emails


      while run this command getting error as below,



      [SymfonyComponentConsoleExceptionCommandNotFoundException] ←[39;49m
      ←[37;41m There are no commands defined in the "insert" namespace.



      please help me to resolve this issue.thank you.










      share|improve this question













      I have written code for cron command as below in lumen (micro framwork of laravel)



      <?php

      namespace AppConsoleCommands;

      use IlluminateConsoleCommand;
      use AppModelsEmailDump;
      use DB;

      /**
      * dumpEmails Class
      *
      * This cron is to dump emails with cron use
      *
      * @author Hetal Gohel <hetal.gohel@brainvire.com>
      *
      */

      class dumpEmails extends Command {

      /**
      * The name and signature of the console command.
      *
      * @var string
      */
      protected $signature = 'insert:emails';

      /**
      * The console command description.
      *
      * @var string
      */
      protected $description = 'This cron is to dump emails with cron use';

      /**
      * Create a new command instance.
      *
      * @return void
      */

      public function __construct()
      {
      parent::__construct();
      }

      /**
      * Execute the console command.
      *
      * @return mixed
      */
      public function handle()
      {
      echo "1";die;
      }
      }


      in kernel file defined as below,



      <?php

      namespace AppConsole;

      use IlluminateConsoleSchedulingSchedule;
      use LaravelLumenConsoleKernel as ConsoleKernel;

      class Kernel extends ConsoleKernel
      {
      /**
      * The Artisan commands provided by your application.
      *
      * @var array
      */
      protected $commands = [
      LaravelistaLumenVendorPublishVendorPublishCommand::class,
      'AppConsoleCommandsdumpEmails',
      ];

      /**
      * Define the application's command schedule.
      *
      * @param IlluminateConsoleSchedulingSchedule $schedule
      * @return void
      */
      // protected function schedule(Schedule $schedule)
      // {
      // return $schedule;
      // }
      }


      I have fired command from console as below,



      php artisan insert:emails


      while run this command getting error as below,



      [SymfonyComponentConsoleExceptionCommandNotFoundException] ←[39;49m
      ←[37;41m There are no commands defined in the "insert" namespace.



      please help me to resolve this issue.thank you.







      php laravel lumen






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 20 hours ago









      hetal gohel

      989




      989
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote













          Please remove __construct and keep just the handle method.



          Also, when you are listing under $commands at Kernel you need to specify the class.



          So your



          `AppConsoleCommandsdumpEmails`


          becomes



              DumpEmails::class


          A few extra tips:




          1. Class names are capitalised; (dumpEmails -> DumpEmails)

          2. Add the { to a new line;


          This



          class dumpEmails extends Command {


          should be



          class DumpEmails extends Command
          {


          I also recommend checking out about PSR-x standards. I left one of the blogs I think might help you kick start with them, but go further! :)



          Last, but not least, do not forget Command Parent already lets you use its command line potential. So if you wish to output and debug, you can do so by using:



          $this->info('Your message to inform');
          $this->error('Your error message');





          share|improve this answer























          • I have done above given changes, still same issue, my lumen version is 5.2.*
            – hetal gohel
            20 hours ago










          • Hmmm, may I ask that you update with the changes please? So I have a map on how things are setting up there? :) As far as I am currently aware I would have believe that removing the __construct and setting the class properly at Kernel class would suffice thinking
            – Diogo Santo
            19 hours ago










          • let me update my updates in anser
            – hetal gohel
            19 hours ago










          • I also made a small change that might be worth to try. If you could, remove the default path form your kernel class, pointing to your command class. If you notice, I just removed AppConsoleCommandsdumpEmails and left as CommandsdumpEmails. That because Kernel might be already mapping it to the default folder
            – Diogo Santo
            19 hours ago










          • this one is also not working
            – hetal gohel
            19 hours ago


















          up vote
          0
          down vote













          I have update my code as per you suggestion as below,



          <?php

          namespace AppConsoleCommands;

          use IlluminateConsoleCommand;
          use AppModelsEmailDump;
          use DB;

          /**
          * dumpEmails Class
          *
          * This cron is to dump emails with cron use
          *
          * @author Hetal Gohel <hetal.gohel@brainvire.com>
          *
          */

          class DumpEmails extends Command
          {

          /**
          * The name and signature of the console command.
          *
          * @var string
          */
          protected $signature = 'insert:emails';

          /**
          * The console command description.
          *
          * @var string
          */
          protected $description = 'This cron is to dump emails with cron use';

          /**
          * Execute the console command.
          *
          * @return mixed
          */
          public function handle()
          {
          echo "1";die;
          }
          }


          in kernel file I have updated as below,



          <?php

          namespace AppConsole;

          use IlluminateConsoleSchedulingSchedule;
          use LaravelLumenConsoleKernel as ConsoleKernel;

          class Kernel extends ConsoleKernel
          {
          /**
          * The Artisan commands provided by your application.
          *
          * @var array
          */
          protected $commands = [
          LaravelistaLumenVendorPublishVendorPublishCommand::class,
          AppConsoleCommandsDumpEmails::class
          ];

          /**
          * Define the application's command schedule.
          *
          * @param IlluminateConsoleSchedulingSchedule $schedule
          * @return void
          */
          // protected function schedule(Schedule $schedule)
          // {
          // return $schedule;
          // }
          }


          but it is still giving me same error , my php version is 5.6.38 and my lumen version is 5.2.*






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372057%2fwhile-run-cron-with-lumen-there-are-no-commands-defined-in-the-insert-namesp%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote













            Please remove __construct and keep just the handle method.



            Also, when you are listing under $commands at Kernel you need to specify the class.



            So your



            `AppConsoleCommandsdumpEmails`


            becomes



                DumpEmails::class


            A few extra tips:




            1. Class names are capitalised; (dumpEmails -> DumpEmails)

            2. Add the { to a new line;


            This



            class dumpEmails extends Command {


            should be



            class DumpEmails extends Command
            {


            I also recommend checking out about PSR-x standards. I left one of the blogs I think might help you kick start with them, but go further! :)



            Last, but not least, do not forget Command Parent already lets you use its command line potential. So if you wish to output and debug, you can do so by using:



            $this->info('Your message to inform');
            $this->error('Your error message');





            share|improve this answer























            • I have done above given changes, still same issue, my lumen version is 5.2.*
              – hetal gohel
              20 hours ago










            • Hmmm, may I ask that you update with the changes please? So I have a map on how things are setting up there? :) As far as I am currently aware I would have believe that removing the __construct and setting the class properly at Kernel class would suffice thinking
              – Diogo Santo
              19 hours ago










            • let me update my updates in anser
              – hetal gohel
              19 hours ago










            • I also made a small change that might be worth to try. If you could, remove the default path form your kernel class, pointing to your command class. If you notice, I just removed AppConsoleCommandsdumpEmails and left as CommandsdumpEmails. That because Kernel might be already mapping it to the default folder
              – Diogo Santo
              19 hours ago










            • this one is also not working
              – hetal gohel
              19 hours ago















            up vote
            1
            down vote













            Please remove __construct and keep just the handle method.



            Also, when you are listing under $commands at Kernel you need to specify the class.



            So your



            `AppConsoleCommandsdumpEmails`


            becomes



                DumpEmails::class


            A few extra tips:




            1. Class names are capitalised; (dumpEmails -> DumpEmails)

            2. Add the { to a new line;


            This



            class dumpEmails extends Command {


            should be



            class DumpEmails extends Command
            {


            I also recommend checking out about PSR-x standards. I left one of the blogs I think might help you kick start with them, but go further! :)



            Last, but not least, do not forget Command Parent already lets you use its command line potential. So if you wish to output and debug, you can do so by using:



            $this->info('Your message to inform');
            $this->error('Your error message');





            share|improve this answer























            • I have done above given changes, still same issue, my lumen version is 5.2.*
              – hetal gohel
              20 hours ago










            • Hmmm, may I ask that you update with the changes please? So I have a map on how things are setting up there? :) As far as I am currently aware I would have believe that removing the __construct and setting the class properly at Kernel class would suffice thinking
              – Diogo Santo
              19 hours ago










            • let me update my updates in anser
              – hetal gohel
              19 hours ago










            • I also made a small change that might be worth to try. If you could, remove the default path form your kernel class, pointing to your command class. If you notice, I just removed AppConsoleCommandsdumpEmails and left as CommandsdumpEmails. That because Kernel might be already mapping it to the default folder
              – Diogo Santo
              19 hours ago










            • this one is also not working
              – hetal gohel
              19 hours ago













            up vote
            1
            down vote










            up vote
            1
            down vote









            Please remove __construct and keep just the handle method.



            Also, when you are listing under $commands at Kernel you need to specify the class.



            So your



            `AppConsoleCommandsdumpEmails`


            becomes



                DumpEmails::class


            A few extra tips:




            1. Class names are capitalised; (dumpEmails -> DumpEmails)

            2. Add the { to a new line;


            This



            class dumpEmails extends Command {


            should be



            class DumpEmails extends Command
            {


            I also recommend checking out about PSR-x standards. I left one of the blogs I think might help you kick start with them, but go further! :)



            Last, but not least, do not forget Command Parent already lets you use its command line potential. So if you wish to output and debug, you can do so by using:



            $this->info('Your message to inform');
            $this->error('Your error message');





            share|improve this answer














            Please remove __construct and keep just the handle method.



            Also, when you are listing under $commands at Kernel you need to specify the class.



            So your



            `AppConsoleCommandsdumpEmails`


            becomes



                DumpEmails::class


            A few extra tips:




            1. Class names are capitalised; (dumpEmails -> DumpEmails)

            2. Add the { to a new line;


            This



            class dumpEmails extends Command {


            should be



            class DumpEmails extends Command
            {


            I also recommend checking out about PSR-x standards. I left one of the blogs I think might help you kick start with them, but go further! :)



            Last, but not least, do not forget Command Parent already lets you use its command line potential. So if you wish to output and debug, you can do so by using:



            $this->info('Your message to inform');
            $this->error('Your error message');






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 19 hours ago

























            answered 20 hours ago









            Diogo Santo

            1477




            1477












            • I have done above given changes, still same issue, my lumen version is 5.2.*
              – hetal gohel
              20 hours ago










            • Hmmm, may I ask that you update with the changes please? So I have a map on how things are setting up there? :) As far as I am currently aware I would have believe that removing the __construct and setting the class properly at Kernel class would suffice thinking
              – Diogo Santo
              19 hours ago










            • let me update my updates in anser
              – hetal gohel
              19 hours ago










            • I also made a small change that might be worth to try. If you could, remove the default path form your kernel class, pointing to your command class. If you notice, I just removed AppConsoleCommandsdumpEmails and left as CommandsdumpEmails. That because Kernel might be already mapping it to the default folder
              – Diogo Santo
              19 hours ago










            • this one is also not working
              – hetal gohel
              19 hours ago


















            • I have done above given changes, still same issue, my lumen version is 5.2.*
              – hetal gohel
              20 hours ago










            • Hmmm, may I ask that you update with the changes please? So I have a map on how things are setting up there? :) As far as I am currently aware I would have believe that removing the __construct and setting the class properly at Kernel class would suffice thinking
              – Diogo Santo
              19 hours ago










            • let me update my updates in anser
              – hetal gohel
              19 hours ago










            • I also made a small change that might be worth to try. If you could, remove the default path form your kernel class, pointing to your command class. If you notice, I just removed AppConsoleCommandsdumpEmails and left as CommandsdumpEmails. That because Kernel might be already mapping it to the default folder
              – Diogo Santo
              19 hours ago










            • this one is also not working
              – hetal gohel
              19 hours ago
















            I have done above given changes, still same issue, my lumen version is 5.2.*
            – hetal gohel
            20 hours ago




            I have done above given changes, still same issue, my lumen version is 5.2.*
            – hetal gohel
            20 hours ago












            Hmmm, may I ask that you update with the changes please? So I have a map on how things are setting up there? :) As far as I am currently aware I would have believe that removing the __construct and setting the class properly at Kernel class would suffice thinking
            – Diogo Santo
            19 hours ago




            Hmmm, may I ask that you update with the changes please? So I have a map on how things are setting up there? :) As far as I am currently aware I would have believe that removing the __construct and setting the class properly at Kernel class would suffice thinking
            – Diogo Santo
            19 hours ago












            let me update my updates in anser
            – hetal gohel
            19 hours ago




            let me update my updates in anser
            – hetal gohel
            19 hours ago












            I also made a small change that might be worth to try. If you could, remove the default path form your kernel class, pointing to your command class. If you notice, I just removed AppConsoleCommandsdumpEmails and left as CommandsdumpEmails. That because Kernel might be already mapping it to the default folder
            – Diogo Santo
            19 hours ago




            I also made a small change that might be worth to try. If you could, remove the default path form your kernel class, pointing to your command class. If you notice, I just removed AppConsoleCommandsdumpEmails and left as CommandsdumpEmails. That because Kernel might be already mapping it to the default folder
            – Diogo Santo
            19 hours ago












            this one is also not working
            – hetal gohel
            19 hours ago




            this one is also not working
            – hetal gohel
            19 hours ago












            up vote
            0
            down vote













            I have update my code as per you suggestion as below,



            <?php

            namespace AppConsoleCommands;

            use IlluminateConsoleCommand;
            use AppModelsEmailDump;
            use DB;

            /**
            * dumpEmails Class
            *
            * This cron is to dump emails with cron use
            *
            * @author Hetal Gohel <hetal.gohel@brainvire.com>
            *
            */

            class DumpEmails extends Command
            {

            /**
            * The name and signature of the console command.
            *
            * @var string
            */
            protected $signature = 'insert:emails';

            /**
            * The console command description.
            *
            * @var string
            */
            protected $description = 'This cron is to dump emails with cron use';

            /**
            * Execute the console command.
            *
            * @return mixed
            */
            public function handle()
            {
            echo "1";die;
            }
            }


            in kernel file I have updated as below,



            <?php

            namespace AppConsole;

            use IlluminateConsoleSchedulingSchedule;
            use LaravelLumenConsoleKernel as ConsoleKernel;

            class Kernel extends ConsoleKernel
            {
            /**
            * The Artisan commands provided by your application.
            *
            * @var array
            */
            protected $commands = [
            LaravelistaLumenVendorPublishVendorPublishCommand::class,
            AppConsoleCommandsDumpEmails::class
            ];

            /**
            * Define the application's command schedule.
            *
            * @param IlluminateConsoleSchedulingSchedule $schedule
            * @return void
            */
            // protected function schedule(Schedule $schedule)
            // {
            // return $schedule;
            // }
            }


            but it is still giving me same error , my php version is 5.6.38 and my lumen version is 5.2.*






            share|improve this answer

























              up vote
              0
              down vote













              I have update my code as per you suggestion as below,



              <?php

              namespace AppConsoleCommands;

              use IlluminateConsoleCommand;
              use AppModelsEmailDump;
              use DB;

              /**
              * dumpEmails Class
              *
              * This cron is to dump emails with cron use
              *
              * @author Hetal Gohel <hetal.gohel@brainvire.com>
              *
              */

              class DumpEmails extends Command
              {

              /**
              * The name and signature of the console command.
              *
              * @var string
              */
              protected $signature = 'insert:emails';

              /**
              * The console command description.
              *
              * @var string
              */
              protected $description = 'This cron is to dump emails with cron use';

              /**
              * Execute the console command.
              *
              * @return mixed
              */
              public function handle()
              {
              echo "1";die;
              }
              }


              in kernel file I have updated as below,



              <?php

              namespace AppConsole;

              use IlluminateConsoleSchedulingSchedule;
              use LaravelLumenConsoleKernel as ConsoleKernel;

              class Kernel extends ConsoleKernel
              {
              /**
              * The Artisan commands provided by your application.
              *
              * @var array
              */
              protected $commands = [
              LaravelistaLumenVendorPublishVendorPublishCommand::class,
              AppConsoleCommandsDumpEmails::class
              ];

              /**
              * Define the application's command schedule.
              *
              * @param IlluminateConsoleSchedulingSchedule $schedule
              * @return void
              */
              // protected function schedule(Schedule $schedule)
              // {
              // return $schedule;
              // }
              }


              but it is still giving me same error , my php version is 5.6.38 and my lumen version is 5.2.*






              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                I have update my code as per you suggestion as below,



                <?php

                namespace AppConsoleCommands;

                use IlluminateConsoleCommand;
                use AppModelsEmailDump;
                use DB;

                /**
                * dumpEmails Class
                *
                * This cron is to dump emails with cron use
                *
                * @author Hetal Gohel <hetal.gohel@brainvire.com>
                *
                */

                class DumpEmails extends Command
                {

                /**
                * The name and signature of the console command.
                *
                * @var string
                */
                protected $signature = 'insert:emails';

                /**
                * The console command description.
                *
                * @var string
                */
                protected $description = 'This cron is to dump emails with cron use';

                /**
                * Execute the console command.
                *
                * @return mixed
                */
                public function handle()
                {
                echo "1";die;
                }
                }


                in kernel file I have updated as below,



                <?php

                namespace AppConsole;

                use IlluminateConsoleSchedulingSchedule;
                use LaravelLumenConsoleKernel as ConsoleKernel;

                class Kernel extends ConsoleKernel
                {
                /**
                * The Artisan commands provided by your application.
                *
                * @var array
                */
                protected $commands = [
                LaravelistaLumenVendorPublishVendorPublishCommand::class,
                AppConsoleCommandsDumpEmails::class
                ];

                /**
                * Define the application's command schedule.
                *
                * @param IlluminateConsoleSchedulingSchedule $schedule
                * @return void
                */
                // protected function schedule(Schedule $schedule)
                // {
                // return $schedule;
                // }
                }


                but it is still giving me same error , my php version is 5.6.38 and my lumen version is 5.2.*






                share|improve this answer












                I have update my code as per you suggestion as below,



                <?php

                namespace AppConsoleCommands;

                use IlluminateConsoleCommand;
                use AppModelsEmailDump;
                use DB;

                /**
                * dumpEmails Class
                *
                * This cron is to dump emails with cron use
                *
                * @author Hetal Gohel <hetal.gohel@brainvire.com>
                *
                */

                class DumpEmails extends Command
                {

                /**
                * The name and signature of the console command.
                *
                * @var string
                */
                protected $signature = 'insert:emails';

                /**
                * The console command description.
                *
                * @var string
                */
                protected $description = 'This cron is to dump emails with cron use';

                /**
                * Execute the console command.
                *
                * @return mixed
                */
                public function handle()
                {
                echo "1";die;
                }
                }


                in kernel file I have updated as below,



                <?php

                namespace AppConsole;

                use IlluminateConsoleSchedulingSchedule;
                use LaravelLumenConsoleKernel as ConsoleKernel;

                class Kernel extends ConsoleKernel
                {
                /**
                * The Artisan commands provided by your application.
                *
                * @var array
                */
                protected $commands = [
                LaravelistaLumenVendorPublishVendorPublishCommand::class,
                AppConsoleCommandsDumpEmails::class
                ];

                /**
                * Define the application's command schedule.
                *
                * @param IlluminateConsoleSchedulingSchedule $schedule
                * @return void
                */
                // protected function schedule(Schedule $schedule)
                // {
                // return $schedule;
                // }
                }


                but it is still giving me same error , my php version is 5.6.38 and my lumen version is 5.2.*







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 19 hours ago









                hetal gohel

                989




                989






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372057%2fwhile-run-cron-with-lumen-there-are-no-commands-defined-in-the-insert-namesp%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

                    Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

                    A Topological Invariant for $pi_3(U(n))$