diff --git a/app/Models/NewTvRequest.php b/app/Models/NewTvRequest.php index 3422543..7daaab4 100644 --- a/app/Models/NewTvRequest.php +++ b/app/Models/NewTvRequest.php @@ -134,6 +134,9 @@ class NewTvRequest extends Model { $tvRequest->validate([ 'code' => 'required|string|unique:App\Models\Tv,code', + 'company_name' => 'nullable|string', + 'address' => 'nullable|string', + 'street_address' => 'nullable|string', 'col1' => 'nullable|string', 'col2' => 'nullable|string', 'col3' => 'nullable|string', @@ -155,6 +158,9 @@ class NewTvRequest extends Model { DB::beginTransaction(); $tv = new Tv(); $tv->code = $tvRequest->code; + $tv->company_name = $tvRequest->company_name; + $tv->address = $tvRequest->address; + $tv->street_address = $tvRequest->street_address; $tv->col1 = $tvRequest->col1; $tv->col2 = $tvRequest->col2; $tv->col3 = $tvRequest->col3; diff --git a/app/Models/Tv.php b/app/Models/Tv.php index 1a55959..1ca1128 100644 --- a/app/Models/Tv.php +++ b/app/Models/Tv.php @@ -53,6 +53,9 @@ class Tv extends Model { ->when($request->id, function($q, $id) { $q->whereNot('id', $id); })], + 'company_name' => 'nullable|string', + 'address' => 'nullable|string', + 'street_address' => 'nullable|string', 'col1' => 'nullable|string', 'col2' => 'nullable|string', 'col3' => 'nullable|string', @@ -69,6 +72,9 @@ class Tv extends Model { try { DB::beginTransaction(); $tv = TV::findOrFail($request->id); + $tv->company_name = $request->company_name; + $tv->address = $request->address; + $tv->street_address = $request->street_address; $tv->code = $request->code; $tv->col1 = $request->col1; $tv->col2 = $request->col2; diff --git a/database/migrations/2024_05_18_033105_tv.php b/database/migrations/2024_05_18_033105_tv.php index b3f1eb6..0803d30 100644 --- a/database/migrations/2024_05_18_033105_tv.php +++ b/database/migrations/2024_05_18_033105_tv.php @@ -15,7 +15,10 @@ return new class extends Migration { $table->string('code', 50)->unique(); $table->string('ik_address_id', 255)->nullable(); $table->integer('version_code')->nullable(); - $table->integer('version_name')->nullable(); + $table->string('version_name')->nullable(); + $table->string('company_name')->nullable(); + $table->string('address')->nullable(); + $table->string('street_address')->nullable(); $table->string('col1', 255)->nullable(); $table->string('col2', 255)->nullable(); $table->string('col3', 255)->nullable();