Skip to content

Commit 26cab6a

Browse files
committed
1 parent 014bf21 commit 26cab6a

File tree

4 files changed

+261
-211
lines changed

4 files changed

+261
-211
lines changed

app/Http/Controllers/Companies/CompaniesController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ public function update(UpdateCompanieRequest $request)
161161
$Companie->comment =$request->comment;
162162
if($request->active) $Companie->active=1;
163163
else $Companie->active = 0;
164+
$Companie->barcode_value =$request->barcode_value;
164165
$Companie->save();
165166
return redirect()->route('companies.show', ['id' => $Companie->id])->with('success', 'Successfully updated companie');
166167
}

app/Models/Companies/Companies.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class Companies extends Model
4444
'recept_controle',
4545
'comment',
4646
'active',
47+
'barcode_value',
4748
];
4849

4950
public function getLabelAttribute()
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::table('companies', function (Blueprint $table) {
15+
$table->string('barcode_value')->nullable()->after('active');
16+
});
17+
}
18+
19+
/**
20+
* Reverse the migrations.
21+
*/
22+
public function down(): void
23+
{
24+
Schema::table('companies', function (Blueprint $table) {
25+
$table->dropColumn('barcode_value');
26+
});
27+
}
28+
};

0 commit comments

Comments
 (0)