@extends('layouts.app') @section('title', 'Data Materials') @section('sidebar') @endsection @section('content')

Data Materials

Kelola data material (Panel, Solid, MDF)

+ Tambah Material
@if(session('success'))
{{ session('success') }}
@endif
Semua Panel Solid MDF Other
@forelse($materials as $material)
@php $categoryColors = [ 'panel' => ['bg' => '#dbeafe', 'text' => '#1e40af'], 'solid' => ['bg' => '#fef3c7', 'text' => '#92400e'], 'mdf' => ['bg' => '#e0e7ff', 'text' => '#3730a3'], 'veneer' => ['bg' => '#fce7f3', 'text' => '#831843'], 'other' => ['bg' => '#f3f4f6', 'text' => '#374151'], ]; $color = $categoryColors[$material->category] ?? $categoryColors['other']; @endphp {{ $material->category }} @if($material->is_active) Aktif @else Nonaktif @endif
@if($material->category == 'panel') 📋 @elseif($material->category == 'solid') 🪵 @elseif($material->category == 'mdf') 📦 @elseif($material->category == 'veneer') 🎨 @else 🔧 @endif

{{ $material->name }}

Tebal: {{ $material->thickness }} mm

@if($material->price_per_m2)

Harga per M²

Rp {{ number_format($material->price_per_m2, 0, ',', '.') }}

@endif @if($material->price_per_unit)

Harga per {{ $material->unit }}

Rp {{ number_format($material->price_per_unit, 0, ',', '.') }}

@endif
Edit
@csrf @method('DELETE')
@empty
🪵

Belum ada data material

Tambah material pertama
@endforelse
{{ $materials->links() }}
@endsection