mirror of
https://repo.getmonero.org/AnonDev/xmrmemes.git
synced 2025-05-02 14:36:15 -04:00
Finish rough draft of website
Update the payment code so everything is working now Improve DB structure Improve design Add API Validate XMR Address upon registration And Much More... Still Need to work on: - SEO - Dropdown in menu (bug, not dropping down)
This commit is contained in:
parent
dbfda5cf9e
commit
821fb9b1ed
30 changed files with 186 additions and 261 deletions
|
@ -1,35 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAddressesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('addresses', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('address', 95)->unique();
|
||||
$table->integer('address_index');
|
||||
$table->string('label');
|
||||
$table->boolean('used');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('addresses');
|
||||
}
|
||||
}
|
|
@ -16,12 +16,13 @@ class CreateMemesTable extends Migration
|
|||
Schema::create('memes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->constrained();
|
||||
$table->foreignId('address_id')->constrained();
|
||||
$table->string('title');
|
||||
$table->string('caption')->nullable();
|
||||
$table->string('image')->nullable();
|
||||
$table->boolean('is_approved')->default(0);
|
||||
$table->boolean('payment_pending')->default(0);
|
||||
$table->string('address', 95)->nullable()->unique();
|
||||
$table->integer('account_index')->nullable()->unique();
|
||||
$table->softDeletes();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
|
|
@ -15,7 +15,7 @@ class CreateTipsTable extends Migration
|
|||
{
|
||||
Schema::create('tips', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('address_id')->constrained();
|
||||
$table->foreignId('meme_id')->constrained();
|
||||
$table->bigInteger('amount');
|
||||
$table->string('txid')->unique();
|
||||
$table->boolean('is_deposit');
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use MoneroIntegrations\MoneroPhp\walletRPC;
|
||||
|
||||
class AddressSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
try {
|
||||
$walletRPC = new walletRPC('127.0.0.1', config('app.xmr_network_port')); // Change to match your wallet (monero-wallet-rpc) IP address and port; 18083 is the customary port for mainnet, 28083 for testnet, 38083 for stagenet
|
||||
$create_wallet = $walletRPC->create_wallet(config('app.xmr_wallet_name'), ''); // Creates a new wallet named memes with no passphrase. Comment this line and edit the next line to use your own wallet
|
||||
} catch (\Exception $e) {
|
||||
dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
$open_wallet = $walletRPC->open_wallet(config('app.xmr_wallet_name'), '');
|
||||
for ($i=0; $i < 100; $i++) {
|
||||
$create_address = $walletRPC->create_address(0, 'Example');
|
||||
}
|
||||
$get_address = $walletRPC->get_address();
|
||||
\DB::table('addresses')->insertOrIgnore($get_address['addresses']);
|
||||
$walletRPC->close_wallet();
|
||||
} catch (\Exception $e) {
|
||||
dump($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
24
database/seeders/WalletSeeder.php
Normal file
24
database/seeders/WalletSeeder.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use MoneroIntegrations\MoneroPhp\walletRPC;
|
||||
|
||||
class WalletSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Create Initial Wallet
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
try {
|
||||
$walletRPC = new walletRPC(config('app.xmr_daemon_ip'), config('app.xmr_network_port')); // Change to match your wallet (monero-wallet-rpc) IP address and port; 18083 is the customary port for mainnet, 28083 for testnet, 38083 for stagenet
|
||||
$create_wallet = $walletRPC->create_wallet(config('app.xmr_wallet_name'), ''); // Creates a new wallet named memes with no passphrase. Comment this line and edit the next line to use your own wallet
|
||||
} catch (\Exception $e) {
|
||||
dump($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue