prepare model done
parent
09c27352f5
commit
6731e8fd47
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class Banner extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'image',
|
||||
'title',
|
||||
'description',
|
||||
'destination',
|
||||
'type',
|
||||
];
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class CoinHistory extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'debit',
|
||||
'credit',
|
||||
'description',
|
||||
'customer_id',
|
||||
'related_type',
|
||||
'related_id',
|
||||
];
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class Customer extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'email',
|
||||
'password',
|
||||
'name',
|
||||
'fullname',
|
||||
'address',
|
||||
'phone',
|
||||
'image',
|
||||
'referral_code',
|
||||
'google_id',
|
||||
'deposit_balance',
|
||||
'coin_balance',
|
||||
'identity_verified',
|
||||
'identity_image',
|
||||
];
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class CustomerLevel extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'description',
|
||||
'key',
|
||||
];
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class CustomerLevelHistory extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'customer_id',
|
||||
'customer_level_id',
|
||||
'date_time',
|
||||
];
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class CustomerRefferal extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'customer_id',
|
||||
'refferal_id',
|
||||
'customer_code',
|
||||
];
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class DepositHistory extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'debit',
|
||||
'credit',
|
||||
'description',
|
||||
'customer_id',
|
||||
'related_type',
|
||||
'related_id',
|
||||
];
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class Location extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'description',
|
||||
'logo',
|
||||
];
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class Notification extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'entity_type',
|
||||
'entity_id',
|
||||
'description',
|
||||
'is_read',
|
||||
];
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class Sale extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'customer_id',
|
||||
'date_time',
|
||||
'amount',
|
||||
'payed_with',
|
||||
'payment_token',
|
||||
'payment_status',
|
||||
'payment_response',
|
||||
'payment_channel',
|
||||
'payment_type',
|
||||
];
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class SaleItem extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'sale_id',
|
||||
'entity_type',
|
||||
'entity_id',
|
||||
'price',
|
||||
'additional_info_json',
|
||||
];
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class Voucher extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'description',
|
||||
'location_id',
|
||||
'username',
|
||||
'password',
|
||||
'price',
|
||||
'discount',
|
||||
'display_price',
|
||||
'quota',
|
||||
'profile',
|
||||
'comment',
|
||||
'expired',
|
||||
];
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class VoucherPrice extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'customer_level_id',
|
||||
'voucher_id',
|
||||
'price',
|
||||
];
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('banners', function (Blueprint $table) {
|
||||
$table->ulid('id')->primary();
|
||||
|
||||
$table->string('image');
|
||||
$table->string('title');
|
||||
$table->string('description')->nullable();
|
||||
$table->string('destination')->nullable();
|
||||
$table->string('type')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->ulid('created_by')->nullable();
|
||||
$table->ulid('updated_by')->nullable();
|
||||
$table->ulid('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('banners');
|
||||
}
|
||||
};
|
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('notifications', function (Blueprint $table) {
|
||||
$table->ulid('id')->primary();
|
||||
|
||||
$table->string('entity_type')->nullable();
|
||||
$table->ulid('entity_id')->nullable();
|
||||
$table->string('description')->nullable();
|
||||
$table->smallInteger('is_read')->default(0);
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->ulid('created_by')->nullable();
|
||||
$table->ulid('updated_by')->nullable();
|
||||
$table->ulid('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('notifications');
|
||||
}
|
||||
};
|
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('vouchers', function (Blueprint $table) {
|
||||
$table->ulid('id')->primary();
|
||||
|
||||
$table->string('name')->nullable();
|
||||
$table->string('description')->nullable();
|
||||
$table->ulid('location_id')->nullable();
|
||||
$table->string('username')->nullable();
|
||||
$table->string('password')->nullable();
|
||||
$table->decimal('price', 20, 2)->default(0);
|
||||
$table->decimal('discount', 20, 0)->default(0);
|
||||
$table->decimal('display_price', 20, 2)->default(0);
|
||||
$table->string('quota')->nullable();
|
||||
$table->string('profile')->nullable();
|
||||
$table->text('comment')->nullable();
|
||||
$table->string('expired')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->ulid('created_by')->nullable();
|
||||
$table->ulid('updated_by')->nullable();
|
||||
$table->ulid('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('vouchers');
|
||||
}
|
||||
};
|
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('voucher_prices', function (Blueprint $table) {
|
||||
$table->ulid('id')->primary();
|
||||
|
||||
$table->ulid('customer_level_id')->nullable();
|
||||
$table->ulid('voucher_id')->nullable();
|
||||
$table->decimal('price', 20, 2)->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->ulid('created_by')->nullable();
|
||||
$table->ulid('updated_by')->nullable();
|
||||
$table->ulid('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('voucher_prices');
|
||||
}
|
||||
};
|
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('customers', function (Blueprint $table) {
|
||||
$table->ulid('id')->primary();
|
||||
|
||||
$table->string('email')->nullable();
|
||||
$table->string('password')->nullable();
|
||||
$table->string('name')->nullable();
|
||||
$table->string('fullname')->nullable();
|
||||
$table->text('address')->nullable();
|
||||
$table->string('phone')->nullable();
|
||||
$table->string('image')->nullable();
|
||||
$table->string('referral_code')->nullable();
|
||||
$table->string('google_id')->nullable();
|
||||
$table->decimal('deposit_balance', 20, 2)->default(0);
|
||||
$table->decimal('coin_balance', 20, 2)->default(0);
|
||||
$table->smallInteger('identity_verified')->nullable();
|
||||
$table->string('identity_image')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->ulid('created_by')->nullable();
|
||||
$table->ulid('updated_by')->nullable();
|
||||
$table->ulid('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('customers');
|
||||
}
|
||||
};
|
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('locations', function (Blueprint $table) {
|
||||
$table->ulid('id')->primary();
|
||||
|
||||
$table->string('name')->nullable();
|
||||
$table->string('description')->nullable();
|
||||
$table->string('logo')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->ulid('created_by')->nullable();
|
||||
$table->ulid('updated_by')->nullable();
|
||||
$table->ulid('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('locations');
|
||||
}
|
||||
};
|
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('customer_levels', function (Blueprint $table) {
|
||||
$table->ulid('id')->primary();
|
||||
|
||||
$table->string('name')->nullable();
|
||||
$table->string('description')->nullable();
|
||||
$table->string('key')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->ulid('created_by')->nullable();
|
||||
$table->ulid('updated_by')->nullable();
|
||||
$table->ulid('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('customer_levels');
|
||||
}
|
||||
};
|
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('customer_level_histories', function (Blueprint $table) {
|
||||
$table->ulid('id')->primary();
|
||||
|
||||
$table->ulid('customer_id')->nullable();
|
||||
$table->ulid('customer_level_id')->nullable();
|
||||
$table->timestamp('date_time')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->ulid('created_by')->nullable();
|
||||
$table->ulid('updated_by')->nullable();
|
||||
$table->ulid('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('customer_level_histories');
|
||||
}
|
||||
};
|
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('deposit_histories', function (Blueprint $table) {
|
||||
$table->ulid('id')->primary();
|
||||
|
||||
$table->decimal('debit', 20, 2)->default(0);
|
||||
$table->decimal('credit', 20, 2)->default(0);
|
||||
$table->text('description')->nullable();
|
||||
$table->ulid('customer_id')->nullable();
|
||||
$table->string('related_type')->nullable();
|
||||
$table->string('related_id')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->ulid('created_by')->nullable();
|
||||
$table->ulid('updated_by')->nullable();
|
||||
$table->ulid('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('deposit_histories');
|
||||
}
|
||||
};
|
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('coin_histories', function (Blueprint $table) {
|
||||
$table->ulid('id')->primary();
|
||||
|
||||
$table->decimal('debit', 20, 2)->default(0);
|
||||
$table->decimal('credit', 20, 2)->default(0);
|
||||
$table->text('description')->nullable();
|
||||
$table->ulid('customer_id')->nullable();
|
||||
$table->string('related_type')->nullable();
|
||||
$table->string('related_id')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->ulid('created_by')->nullable();
|
||||
$table->ulid('updated_by')->nullable();
|
||||
$table->ulid('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('coin_histories');
|
||||
}
|
||||
};
|
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('customer_refferals', function (Blueprint $table) {
|
||||
$table->ulid('id')->primary();
|
||||
|
||||
$table->ulid('customer_id')->nullable();
|
||||
$table->ulid('refferal_id')->nullable();
|
||||
$table->string('customer_code')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->ulid('created_by')->nullable();
|
||||
$table->ulid('updated_by')->nullable();
|
||||
$table->ulid('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('customer_refferals');
|
||||
}
|
||||
};
|
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('sales', function (Blueprint $table) {
|
||||
$table->ulid('id')->primary();
|
||||
|
||||
$table->ulid('customer_id')->nullable();
|
||||
$table->timestamp('date_time')->nullable();
|
||||
$table->decimal('amount', 20, 2)->default(0);
|
||||
$table->string('payed_with')->nullable();
|
||||
$table->string('payment_token')->nullable();
|
||||
$table->string('payment_status')->nullable();
|
||||
$table->string('payment_response')->nullable();
|
||||
$table->string('payment_channel')->nullable();
|
||||
$table->string('payment_type')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->ulid('created_by')->nullable();
|
||||
$table->ulid('updated_by')->nullable();
|
||||
$table->ulid('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('sales');
|
||||
}
|
||||
};
|
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('sale_items', function (Blueprint $table) {
|
||||
$table->ulid('id')->primary();
|
||||
|
||||
$table->ulid('sale_id')->nullable();
|
||||
$table->string('entity_type')->nullable();
|
||||
$table->ulid('entity_id')->nullable();
|
||||
$table->decimal('price', 20, 2)->default(0);
|
||||
$table->text('additional_info_json')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->ulid('created_by')->nullable();
|
||||
$table->ulid('updated_by')->nullable();
|
||||
$table->ulid('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('sale_items');
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue