@extends('layouts.app') @section('title', 'Requests') @section('content')

Requests

@if(auth()->user()->isOwner()) New Request @endif

All Requests

@if(request('search')) @endif
@forelse($requests as $request) @empty @endforelse
ID Type Owner Phone Note Status Created Actions
{{ $request->id }} {{ $request->requestType->name }} {{ $request->user->name }} {{ $request->user->phone }} {{ Str::limit($request->note, 50) }} @php $statusColors = [ 'pending' => ['bg' => 'bg-warning', 'text' => 'text-dark'], 'in_progress' => ['bg' => 'bg-info', 'text' => 'text-white'], 'completed' => ['bg' => 'bg-success', 'text' => 'text-white'], 'cancelled' => ['bg' => 'bg-danger', 'text' => 'text-white'] ]; $status = $request->status; $colors = $statusColors[$status]; @endphp {{ ucfirst($status) }} {{ $request->created_at->format('M d, Y H:i') }} @if(auth()->user()->isAdmin() || auth()->user()->isOperation()) @endif
No requests found
@endsection