cms-laravel/resources/views/livewire/station-locator/branch-list.blade.php

47 lines
2.2 KiB
PHP

@extends('layouts.app')
@section('content')
<div class="container mt-4">
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h4>Branch List</h4>
<a href="{{ route('branches.create') }}" class="btn btn-primary">Add Branch</a>
</div>
<div class="card-body">
<table class="table table-bordered">
<thead>
<tr>
<th>Branch Code</th>
<th>Branch Name</th>
<th>Details</th>
<th>Date Created</th>
<th>Created By</th>
<th>Date Modified</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@forelse ($branches as $branch)
<tr>
<td>{{ $branch['code'] }}</td>
<td>{{ $branch['name'] }}</td>
<td>{{ $branch['details'] }}</td>
<td>{{ \Carbon\Carbon::parse($branch['createdAt'])->format('M d, Y H:i') }}</td>
<td>{{ $branch['created_by'] ?? 'N/A' }}</td>
<td>{{ \Carbon\Carbon::parse($branch['updatedAt'])->format('M d, Y H:i') }}</td>
<td>
<a href="{{ route('branches.edit', $branch['id']) }}" class="btn btn-sm btn-warning">Edit</a>
<button class="btn btn-sm btn-danger" wire:click="delete({{ $branch['id'] }})" wire:loading.attr="disabled" wire:target="delete">Delete</button>
</td>
</tr>
@empty
<tr>
<td colspan="7" class="text-center">No branches found.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
@endsection