You are on page 1of 2

@extends('master')

@section('title', 'Dashboard smartphone')

@section('content')
<style>
.bdr {
border-radius: 8px;
overflow: hidden;
}
</style>
<div class="container pt-4 bg-white">
<div class="row">
<div class="col-md-12">
<div class="d-flex justify-content-between">
<h2>Dashboard smartphone</h2>
<form class="form-inline">
<a href="{{ route('smartphone.create') }}" class="btn btn-
primary">Tambah</a>
</form>
</div>
<div class="py-4">
@if (session()->has('message'))
<div class="my-3">
<div class="alert alert-success">
{{ session()->get('message') }}
</div>
</div>
@endif
</div>
<div class="table-responsive bdr ">
<table class="table table-striped">
<thead class="bg-primary text-white">
<tr align="center">
<th>No</th>
<th>ram</th>
<th>Nama smartphone</th>
<th>Penyimpanan</th>
<th>kamera</th>
<th>harga</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
@forelse ($smartphones as $smartphone)
<tr align="center">
<td>{{ $loop->iteration }}</td>
<td>{{ $smartphone->barang->ram ?? 0 }}</td>
<td>{{ $smartphone->nama_smartphone.index
}}</td>
<td>{{ $smartphone->barang->penyimpanan ??
0 }}</td>
<td>{{ $smartphone->barang->kamera ?? 0 }}</td>
<td>{{ $smartphone->alamat }}</td>
<td>
<div class="d-flex justify-content-around">
<a href="{{ route('smartphone.edit',
['smartphone' => $smartphone->id]) }}"
class="btn btn-warning btn-
block">Edit</a>
<form
action="{{ route('smartphone.destroy', ['smartphone' => $smartphone->id]) }}"
method="POST" class="ms-1">
@method('DELETE')
@csrf
<button type="submit" class="btn
btn-danger">Delete</button>
</form>
</div>
</td>
</tr>
@empty
<td colspan="11">Tidak ada data...</td>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection

You might also like