Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F25244554
AccountDump.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
AccountDump.php
View Options
<?php
namespace
AuthGrove\Console\Commands
;
use
Illuminate\Console\Command
;
use
AuthGrove\User
as
User
;
class
AccountDump
extends
Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected
$signature
=
'account:dump {--format=human}'
;
/**
* The console command description.
*
* @var string
*/
protected
$description
=
'Dumps the accounts list.'
;
/**
* Create a new command instance.
*
* @return void
*/
public
function
__construct
()
{
parent
::
__construct
();
}
/**
* Execute the console command.
*
* @return mixed
*/
public
function
handle
()
{
$format
=
$this
->
option
(
'format'
);
$attributes
=
User
::
getDefaultAttributes
();
$users
=
User
::
all
(
$attributes
)->
toArray
();
switch
(
$format
)
{
case
"human"
:
$headers
=
array_map
(
'
\A
uthGrove
\U
ser::localizeAttribute'
,
$attributes
);
$this
->
table
(
$headers
,
$users
);
break
;
case
"json"
:
echo
json_encode
(
$users
);
break
;
default
:
$this
->
error
(
"Unknown format: $format"
);
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Apr 9, 02:50 (1 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3603874
Default Alt Text
AccountDump.php (1 KB)
Attached To
Mode
rGROVE Auth Grove
Attached
Detach File
Event Timeline
Log In to Comment