<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ashallendesign / laravel-command-spinner example snippets
use AshAllenDesign\CommandSpinner\Traits\HasSpinner;
class YourCommand extends Command
{
use HasSpinner;
public function handle(): int
{
$this->withSpinner(function () {
// Run your code here.
});
}
}
use AshAllenDesign\CommandSpinner\Traits\HasSpinner;
class YourCommand extends Command
{
use HasSpinner;
public function handle(): int
{
$this->withSpinner(function () {
// Run your code here.
}, 'Fetching data from API...');
}
}
use AshAllenDesign\CommandSpinner\Classes\SpinnerType;
use AshAllenDesign\CommandSpinner\Traits\HasSpinner;
class YourCommand extends Command
{
use HasSpinner;
public function handle(): int
{
$this->withSpinner(function () {
// Run your code here.
}, 'Fetching data from API...', SpinnerType::BLOCK_VARIANT_1);
}
}
use AshAllenDesign\CommandSpinner\Classes\SpinnerType;
use AshAllenDesign\CommandSpinner\Traits\HasSpinner;
class YourCommand extends Command
{
use HasSpinner;
public function handle(): int
{
$this->withSpinner(
closure: function () {
$this->fetchDataFromAPI();
},
outputText: 'Fetching data from API...',
spinnerType: SpinnerType::BLOCK_VARIANT_1
);
}
}
use AshAllenDesign\CommandSpinner\Traits\HasSpinner;
class YourCommand extends Command
{
use HasSpinner;
public function handle(): int
{
$result = $this->withSpinner(function () {
return (new Calculator)->calculate();
});
$this->line($result);
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.