AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2026_11_26_000001_add_easyparcel.php 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. return new class extends Migration
  6. {
  7. /**
  8. * EasyParcel: the merchant's connected account, where parcels are collected from, and the courier booked for an order.
  9. */
  10. public function up(): void
  11. {
  12. Schema::create('easyparcel_accounts', function (Blueprint $table) {
  13. $table->id();
  14. $table->foreignId('store_id')->unique()->constrained()->cascadeOnDelete();
  15. $table->string('account_name')->nullable();
  16. // Kept encrypted. They let us act on the merchant's EasyParcel account.
  17. $table->text('access_token');
  18. $table->text('refresh_token')->nullable();
  19. $table->timestamp('expires_at')->nullable();
  20. $table->timestamps();
  21. });
  22. Schema::table('stores', function (Blueprint $table) {
  23. // Where couriers collect parcels from: name, phone, line1, line2, city, postcode, state.
  24. $table->json('pickup_address')->nullable()->after('free_shipping_over');
  25. // The usual parcel, used to fill in the booking form: weight in grams, size in cm.
  26. $table->unsignedInteger('parcel_weight')->default(1000)->after('pickup_address');
  27. $table->json('parcel_size')->nullable()->after('parcel_weight');
  28. });
  29. Schema::table('orders', function (Blueprint $table) {
  30. $table->string('shipment_number')->nullable()->after('tracking_number');
  31. $table->string('shipment_order_number')->nullable()->after('shipment_number');
  32. $table->unsignedInteger('shipment_cost')->nullable()->after('shipment_order_number');
  33. $table->text('label_url')->nullable()->after('shipment_cost');
  34. $table->text('tracking_url')->nullable()->after('label_url');
  35. });
  36. }
  37. public function down(): void
  38. {
  39. Schema::table('orders', function (Blueprint $table) {
  40. $table->dropColumn(['shipment_number', 'shipment_order_number', 'shipment_cost', 'label_url', 'tracking_url']);
  41. });
  42. Schema::table('stores', function (Blueprint $table) {
  43. $table->dropColumn(['pickup_address', 'parcel_weight', 'parcel_size']);
  44. });
  45. Schema::dropIfExists('easyparcel_accounts');
  46. }
  47. };