Migration for e_invoice

This commit is contained in:
David Bomba 2024-06-02 18:37:56 +10:00
parent c8dad43052
commit 6ce1ea9944
3 changed files with 30 additions and 0 deletions

View File

@ -51,6 +51,7 @@ use Laracasts\Presenter\PresentableTrait;
* @property int|null $last_login
* @property int|null $industry_id
* @property int|null $size_id
* @property object|null $e_invoice
* @property string|null $address1
* @property string|null $address2
* @property string|null $city
@ -185,6 +186,7 @@ class Client extends BaseModel implements HasLocalePreference
'deleted_at' => 'timestamp',
'last_login' => 'timestamp',
'tax_data' => 'object',
'e_invoice' => 'object',
];
protected $touches = [];

View File

@ -164,6 +164,7 @@ class ClientTransformer extends EntityTransformer
'routing_id' => (string) $client->routing_id,
'tax_info' => $client->tax_data ?: new \stdClass(),
'classification' => $client->classification ?: '',
'e_invoice' => $client->e_invoice ?: new \stdClass(),
];
}
}

View File

@ -0,0 +1,27 @@
<?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::table('clients', function (Blueprint $table) {
$table->mediumText('e_invoice')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
}
};