Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F11545496
PackageSkus.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
991 B
Referenced Files
None
Subscribers
None
PackageSkus.php
View Options
<?php
namespace
App\Console\Commands
;
use
App\Package
;
use
Illuminate\Console\Command
;
class
PackageSkus
extends
Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected
$signature
=
'package:skus'
;
/**
* The console command description.
*
* @var string
*/
protected
$description
=
"List SKUs for packages."
;
/**
* Create a new command instance.
*
* @return void
*/
public
function
__construct
()
{
parent
::
__construct
();
}
/**
* Execute the console command.
*
* @return mixed
*/
public
function
handle
()
{
$packages
=
Package
::
all
();
foreach
(
$packages
as
$package
)
{
$this
->
info
(
sprintf
(
"Package: %s"
,
$package
->
title
));
foreach
(
$package
->
skus
as
$sku
)
{
$this
->
info
(
sprintf
(
" SKU: %s (%d)"
,
$sku
->
title
,
$sku
->
pivot
->
qty
));
}
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Sep 29, 12:45 AM (16 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1455276
Default Alt Text
PackageSkus.php (991 B)
Attached To
Mode
R2 kolab
Attached
Detach File
Event Timeline
Log In to Comment