frontend update

This commit is contained in:
carodej
2020-06-03 10:58:44 +02:00
parent 331ee52ea3
commit ca14838212
60 changed files with 1871 additions and 710 deletions
@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePlansTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('plans', function (Blueprint $table) {
$table->bigIncrements('id');
$table->boolean('status')->default(1);
$table->text('name');
$table->text('price');
$table->integer('capacity');
$table->longText('description')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('plans');
}
}
@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePaymentGatewaysTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('payment_gateways', function (Blueprint $table) {
$table->bigIncrements('id');
$table->boolean('status')->default(0);
$table->boolean('sandbox')->default(0);
$table->text('name');
$table->text('slug');
$table->text('logo');
$table->text('client_id')->nullable();
$table->text('secret')->nullable();
$table->text('webhook')->nullable();
$table->longText('optional')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('payment_gateways');
}
}
@@ -0,0 +1,44 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddAttributesToUserSettingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('user_settings', function (Blueprint $table) {
$table->text('billing_name')->nullable();
$table->text('billing_address')->nullable();
$table->text('billing_state')->nullable();
$table->text('billing_city')->nullable();
$table->text('billing_postal_code')->nullable();
$table->text('billing_country')->nullable();
$table->text('billing_phone_number')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('user_settings', function (Blueprint $table) {
$table->dropColumn('billing_name');
$table->dropColumn('billing_address');
$table->dropColumn('billing_state');
$table->dropColumn('billing_city');
$table->dropColumn('billing_postal_code');
$table->dropColumn('billing_country');
$table->dropColumn('billing_phone_number');
});
}
}
@@ -0,0 +1,42 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateInvoicesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('invoices', function (Blueprint $table) {
$table->bigIncrements('id');
$table->text('token');
$table->text('order');
$table->text('user_id');
$table->text('plan_id');
$table->longText('seller');
$table->longText('client');
$table->longText('bag');
$table->longText('notes')->nullable();
$table->text('total');
$table->text('currency');
$table->text('path');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('invoices');
}
}
+3 -1
View File
@@ -11,6 +11,8 @@ class DatabaseSeeder extends Seeder
*/
public function run()
{
// $this->call(UsersTableSeeder::class);
$this->call(PaymentGatewaysSeeder::class);
$this->call(PlansSeeder::class);
$this->call(InvoicesSeeder::class);
}
}
+65
View File
@@ -0,0 +1,65 @@
<?php
use Illuminate\Database\Seeder;
class InvoicesSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$user = \App\User::find(1);
$seller = [
'settings' => [
'billing_name' => 'VueFileManager',
'billing_address' => 'Somewhere 32',
'billing_state' => 'Washington',
'billing_city' => 'Manchester',
'billing_postal_code' => '04001',
'billing_country' => 'The USA',
'billing_phone_number' => '490321-6354774',
'billing_vat_number' => '7354724626246',
]
];
$invoice = \App\Invoice::create([
'token' => \Illuminate\Support\Str::random(),
'order' => '200001',
'user_id' => 1,
'plan_id' => 1,
'seller' => [
'billing_name' => $seller['settings']['billing_name'],
'billing_address' => $seller['settings']['billing_address'],
'billing_state' => $seller['settings']['billing_state'],
'billing_city' => $seller['settings']['billing_city'],
'billing_postal_code' => $seller['settings']['billing_postal_code'],
'billing_country' => $seller['settings']['billing_country'],
'billing_phone_number' => $seller['settings']['billing_phone_number'],
'billing_vat_number' => $seller['settings']['billing_vat_number'],
],
'client' => [
'billing_name' => $user->settings->billing_name,
'billing_address' => $user->settings->billing_address,
'billing_state' => $user->settings->billing_state,
'billing_city' => $user->settings->billing_city,
'billing_postal_code' => $user->settings->billing_postal_code,
'billing_country' => $user->settings->billing_country,
'billing_phone_number' => $user->settings->billing_phone_number,
],
'bag' => [
[
'description' => 'Subscription - Starter Pack',
'date' => '01-05-2020 01-06-2020',
'amount' => 2.99,
]
],
'notes' => '',
'total' => 2.99,
'currency' => 'USD',
'path' => '/invoices/200001-8HUrJkNdLKilNMeF.pdf',
]);
}
}
+28
View File
@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Seeder;
class PaymentGatewaysSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
// Create Stripe default record
DB::table('payment_gateways')->insert([
'logo' => '/assets/images/stripe-logo-thumbnail.png',
'name' => 'Stripe',
'slug' => 'stripe',
]);
// Create PayPal default record
DB::table('payment_gateways')->insert([
'logo' => '/assets/images/paypal-logo-thumbnail.png',
'name' => 'Paypal',
'slug' => 'paypal',
]);
}
}
+42
View File
@@ -0,0 +1,42 @@
<?php
use Carbon\Carbon;
use Illuminate\Database\Seeder;
class PlansSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('Plans')->insert([
'name' => 'Starter Pack',
'description' => 'Faucibus massa amet fermentum sodales natoque mauris',
'price' => '9.90',
'capacity' => '200',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
]);
DB::table('Plans')->insert([
'name' => 'Professional Pack',
'description' => 'Fusce morbi a massa ullamcorper inceptos fermentum',
'price' => '19.90',
'capacity' => '500',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
]);
DB::table('Plans')->insert([
'name' => 'Business Pack',
'description' => 'Taciti metus proin sociis aenean facilisis eu',
'price' => '44.90',
'capacity' => '1000',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
]);
}
}