Page MenuHomePhorge

ListSettingsCommand.php
No OneTemporary

Authored By
Unknown
Size
959 B
Referenced Files
None
Subscribers
None

ListSettingsCommand.php

<?php
namespace App\Console\Commands\Tenant;
use App\Console\Command;
use App\Tenant;
class ListSettingsCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'tenant:list-settings {tenant}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'List settings for the tenant.';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$tenant = $this->getObject(Tenant::class, $this->argument('tenant'), 'title');
if (!$tenant) {
$this->error("Unable to find the tenant.");
return 1;
}
$tenant->settings()->orderBy('key')->get()
->each(function ($entry) {
$text = "{$entry->key}: {$entry->value}";
$this->info($text);
});
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, Apr 4, 1:52 AM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18740631
Default Alt Text
ListSettingsCommand.php (959 B)

Event Timeline