Se colocaran ejercios para practicar de codigobit
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- <?php
-
- namespace App\Commands;
-
- use Illuminate\Console\Scheduling\Schedule;
- use LaravelZero\Framework\Commands\Command;
-
- class Factorial extends Command
- {
- /**
- * The signature of the command.
- *
- * @var string
- */
- protected $signature = 'factorial';
-
- /**
- * The description of the command.
- *
- * @var string
- */
- protected $description = 'este comando es para calcular el factorial de un numero';
-
- /**
- * Execute the console command.
- *
- * @return mixed
- */
- public function handle()
- {
- $num=10;
- $fact=1;
- for ($i = $num; $i > 0; $i--)
- {
- $fact= $fact * $i;
- }
- echo "El numero factorial es el siguiente = ".$fact;
-
- }
-
- /**
- * Define the command's schedule.
- *
- * @param \Illuminate\Console\Scheduling\Schedule $schedule
- * @return void
- */
- public function schedule(Schedule $schedule): void
- {
- // $schedule->command(static::class)->everyMinute();
- }
- }
|