@extends('layouts.argon') @section('content')
Search leave record here!
@csrf

Leave Recod
@foreach ($leaverecords as $deps) @endforeach
Name Leave Period Type of leave Attachment Allow Leaves Awail Leaves Left Leaves
{{ $deps->username }}
@php $getdep = DB::table('odepartments')->where('id', $deps->depid)->first(); @endphp @if(isset($getdep->name))

{{ $getdep->name }}

@endif
@if($deps->date_start == $deps->date_end) {{ \Carbon\Carbon::parse($deps->date_start)->format('j F, Y') }} @else {{ \Carbon\Carbon::parse($deps->date_start)->format('j F, Y') }}
to
{{ \Carbon\Carbon::parse($deps->date_end)->format('j F, Y') }} @endif
{{ $deps->leave_type }} @if(isset($deps->file_path)) @if(Str::contains($deps->file_path, ['docx']))

View

@else

View

@endif @endif
@php $getuser = DB::table('users')->where('id', $deps->userid)->first(); @endphp @if(isset($getuser->allowleaves)) {{ $getuser->allowleaves }} @endif @php $getsum = DB::table('leave_records')->where('userid', $deps->userid)->sum('dayscount'); @endphp {{ $getsum }} @if(isset($getuser->allowleaves)) {{ $getuser->allowleaves - $getsum }} @endif
@endsection