cotizaweb/resources/views/companies/index.blade.php
jesusfb 161fcee049
Some checks are pending
Deploy to EC2 cotiza / deploy (push) Waiting to run
first commit
2026-04-24 12:53:27 -07:00

58 lines
1.8 KiB
PHP

@extends('layouts.app')
@section('content')
<div class="container-fluid">
<h2>Empresas</h2>
<a href="{{ route('companies.create') }}" class="btn btn-primary mb-3">
Nueva Empresa
</a>
@if(session('success'))
<div class="alert alert-success">{{ session('success') }}</div>
@endif
<table class="table table-bordered">
<thead>
<tr>
<th>ID</th>
<th>Nombre</th>
<th>Email</th>
<th>Plan</th>
<th>Activo</th>
<th>Acciones</th>
</tr>
</thead>
<tbody>
@foreach($companies as $company)
<tr>
<td>{{ $company->id }}</td>
<td>{{ $company->nombre }}</td>
<td>{{ $company->email }}</td>
<td>{{ ucfirst($company->plan) }}</td>
<td>
{!! $company->activo
? '<span class="badge bg-success">Sí</span>'
: '<span class="badge bg-danger">No</span>' !!}
</td>
<td>
<a href="{{ route('companies.edit',$company) }}"
class="btn btn-warning btn-sm">Editar</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('¿Eliminar empresa?')">
Borrar
</button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endsection