Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
monero-project
CCS Backend
Commits
14601bbf
Commit
14601bbf
authored
Dec 31, 2018
by
beardedwarrior
Browse files
monero integrated address generator
parent
3a3ad37e
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Console/Commands/GenerateAddresses.php
0 → 100644
View file @
14601bbf
<?php
namespace
App\Console\Commands
;
use
App\Project
;
use
Illuminate\Console\Command
;
use
Illuminate\Support\Facades\Storage
;
use
Monero\WalletOld
;
class
GenerateAddresses
extends
Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected
$signature
=
'generate:addresses'
;
/**
* The console command description.
*
* @var string
*/
protected
$description
=
'Generates monero addresses for any merged proposals'
;
/**
* Create a new command instance.
*
* @return void
*/
public
function
__construct
()
{
parent
::
__construct
();
}
/**
* Execute the console command.
*
* @return mixed
*/
public
function
handle
()
{
$projects
=
Project
::
whereNotNull
(
'filename'
)
->
whereNull
(
'payment_id'
)
->
where
(
'state'
,
'FUNDING-REQUIRED'
)
->
get
();
$wallet
=
new
WalletOld
();
foreach
(
$projects
as
$project
)
{
$addressDetails
=
$wallet
->
getPaymentAddress
();
$project
->
address_uri
=
$wallet
->
createQrCodeString
(
$addressDetails
[
'address'
]);
$project
->
address
=
$addressDetails
[
'address'
];
$project
->
payment_id
=
$addressDetails
[
'paymentId'
];
Storage
::
disk
(
'public'
)
->
put
(
"/img/qrcodes/
{
$project
->
payment_id
}
.png"
,
$project
->
generateQrcode
());
$project
->
qr_code
=
"img/qrcodes/
{
$project
->
payment_id
}
.png"
;
$project
->
raised_amount
=
0
;
$project
->
save
();
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment