2025-05-08 13:03:09 +05:45

51 lines
1.8 KiB
PHP

@extends('layouts.app')
@section('content')
<div class="container">
<h1>Companies</h1>
<a href="{{ route('companies.create') }}" class="btn btn-primary mb-3">Add Company</a>
@if (session('success'))
<div class="alert alert-success">{{ session('success') }}</div>
@endif
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Logo</th>
<th>Website</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
@foreach($companies as $company)
<tr>
<td>{{ $company->name }}</td>
<td>{{ $company->email }}</td>
<td>
@if($company->logo)
<img src="{{ asset('storage/' . $company->logo) }}" alt="Logo" width="100">
@else
N/A
@endif
</td>
<td>{{ $company->website }}</td>
<td>
<a href="{{ route('companies.show', $company) }}" class="btn btn-info btn-sm">View</a>
<a href="{{ route('companies.edit', $company) }}" class="btn btn-warning btn-sm">Edit</a>
<form action="{{ route('companies.destroy', $company) }}" method="POST" style="display:inline;">
@csrf
@method('DELETE')
<button class="btn btn-danger btn-sm" onclick="return confirm('Are you sure?')">Delete</button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
{{ $companies->links() }}
</div>
@endsection