Feat: Adding Store Details Page
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
/**
|
||||
* A single-row table for the store's own contact/legal details — edited via
|
||||
* the Filament "Store Details" settings page (Modules\Core\Store\Filament\
|
||||
* Pages\ManageStoreDetails) and read via Modules\Core\Store\Services\
|
||||
* StoreDetailsService. Not config, since a shop owner needs to change these
|
||||
* (e.g. a new IBAN, a new address) without a code deploy.
|
||||
*
|
||||
* name/address/bank_transfer_instructions are locale-keyed JSON — same
|
||||
* shape/resolution as Modules\Core\Payment\Models\PaymentMethod::$name (see
|
||||
* that model's own docblock): $storeDetails->translate('name'). tax_identifier
|
||||
* (ΑΦΜ) and registration_number (ΓΕΜΗ) are legal identifiers, not
|
||||
* locale-dependent text, so they stay plain strings — same for phone.
|
||||
*
|
||||
* No seeder inserting the singleton row — StoreDetailsService::current()
|
||||
* lazily creates it (all-null) on first read, same shape as any other
|
||||
* firstOrCreate()-backed singleton in this codebase.
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('store_details', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->json('name')->nullable();
|
||||
$table->json('address')->nullable();
|
||||
$table->string('phone')->nullable();
|
||||
$table->string('tax_identifier')->nullable();
|
||||
$table->string('registration_number')->nullable();
|
||||
$table->json('bank_transfer_instructions')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('store_details');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user