added filamentstock in filaments

This commit is contained in:
2025-03-11 12:23:46 +01:00
parent bca04897da
commit cbfe637f84
2 changed files with 33 additions and 1 deletions
@@ -0,0 +1,30 @@
<?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('filaments', function (Blueprint $table) {
// adding stock to filaments table
$table->integer('stock')->default(0);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('filaments', function (Blueprint $table) {
// removing stock from filaments table
$table->dropColumn('stock');
});
}
};
@@ -17,8 +17,9 @@
<thead class="bg-zinc-900 border-b border-rose-500">
<tr>
<th class="py-6">Name</th>
<th class="py-6">Count</th>
<th class="py-6">Filaments</th>
<th class="py-6">Website</th>
<th class="py-6">Stock</th>
<th class="py-6">Edit</th>
<th class="py-6">Delete</th>
</tr>
@@ -29,6 +30,7 @@
<td class="text-center py-4"><a href="/manufacturers/{{ $manufacturer->id }}" class="flex justify-center">{{ $manufacturer->name }}</a></td>
<td class="text-center py-4"><a href="/manufacturers/{{ $manufacturer->id }}" class="bg-accent px-2 py-1 rounded">{{ $manufacturer->filament_count }}</a></td>
<td class="text-center py-4"><a class="flex gap-2 justify-center" target="_blank" href="{{ $manufacturer->website }}">{{ $manufacturer->website }} @isset($manufacturer->website) <flux:icon.arrow-top-right-on-square /> @endisset</a></td>
<td class="text-center py-4"></td>
<td class="text-center py-4"><a href="{{ route('manufacturers.edit', $manufacturer->id) }}" class="flex justify-center"><flux:icon.ellipsis class="hover:text-zinc-50 hover:bg-zinc-500 stroke-3 rounded "/></a></td>
<td class="text-center py-4"><a href="{{ route('manufacturers.edit', $manufacturer->id) }}" class="flex justify-center"><flux:icon.x-mark class="hover:text-zinc-50 hover:bg-zinc-500 stroke-3 rounded "/></a></td>