Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F120836068
PackageSkus.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
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
Fri, Apr 24, 1:25 PM (1 d, 11 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
3d/71/c786384652c6086076a0ce92555f
Default Alt Text
PackageSkus.php (991 B)
Attached To
Mode
rK kolab
Attached
Detach File
Event Timeline