Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
beardedwarrior
ffs
Commits
14601bbf
Commit
14601bbf
authored
Dec 31, 2018
by
beardedwarrior
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
monero integrated address generator
parent
3a3ad37e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
+58
-0
app/Console/Commands/GenerateAddresses.php
app/Console/Commands/GenerateAddresses.php
+58
-0
No files found.
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
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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