Skip to content

Commit

Permalink
add appointments in branch section
Browse files Browse the repository at this point in the history
  • Loading branch information
itsemon245 committed Jul 6, 2024
1 parent 3d0b3e3 commit a2f9db8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
31 changes: 31 additions & 0 deletions app/Http/Controllers/Backend/UserAppointmentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use App\Models\UserAppointment;
use App\Notifications\AppointmentApprovedNotification;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Notification;
use Log;
Expand All @@ -35,12 +36,22 @@ public function index() {
$appointments = $expert->appointments()
->unapproved()
->with('map', 'user')
->where(function(Builder $builder){
if (request('map_id')) {
$builder->where('map_id', request('map_id'));
}
})
->latest()
->paginate(paginateCount());
} else {
$appointments = UserAppointment::unapproved()
->whereNull('expert_profile_id')
->with('map', 'user')
->where(function(Builder $builder){
if (request('map_id')) {
$builder->where('map_id', request('map_id'));
}
})
->latest()
->paginate(paginateCount());
}
Expand Down Expand Up @@ -95,12 +106,22 @@ public function approvedList() {
$appointments = $expert->appointments()
->approvedOnly()
->with('map', 'user')
->where(function(Builder $builder){
if (request('map_id')) {
$builder->where('map_id', request('map_id'));
}
})
->latest()
->paginate(paginateCount());
} else {
$appointments = UserAppointment::approvedOnly()
->whereNull('expert_profile_id')
->with('map', 'user')
->where(function(Builder $builder){
if (request('map_id')) {
$builder->where('map_id', request('map_id'));
}
})
->latest()
->paginate(paginateCount());
}
Expand All @@ -117,12 +138,22 @@ public function completedList() {
$appointments = $expert->appointments()
->completedOnly()
->with('map', 'user')
->where(function(Builder $builder){
if (request('map_id')) {
$builder->where('map_id', request('map_id'));
}
})
->latest()
->paginate(paginateCount());
} else {
$appointments = UserAppointment::completedOnly()
->whereNull('expert_profile_id')
->with('map', 'user')
->where(function(Builder $builder){
if (request('map_id')) {
$builder->where('map_id', request('map_id'));
}
})
->latest()
->paginate(paginateCount());
}
Expand Down
6 changes: 5 additions & 1 deletion resources/views/backend/map/showMaps.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ class="w-100 rounded-top rounded-left rounded-right shadow-top shadow-start shad
height="350x" style="border:0;" allowfullscreen="" loading="lazy"
referrerpolicy="no-referrer-when-downgrade"></iframe>
<div class="card-body p-2">
<p class="fw-bold text-capitalize mb-1 fs-4 mb-0">{{ $map->location }}</p>
<p class="fw-bold text-capitalize mb-1 fs-4">{{ $map->location }}</p>
<p class="fw-bold text-capitalize mb-1 fs-5">{{ $map->district . ', ' . $map->thana }}</p>
<div class="address mb-2">{!! $map->address !!}</div>
<p class="">
<small class="text-muted">{{ $map->updated_at->diffForHumans() }}</small>
</p>
@canany('update map')
<x-backend.ui.button class="btn-success btn-sm" type='custom'
href="{{ route('user-appointments.index', ['map_id' => $map->id]) }}">Appoinments</x-backend.ui.button>
@endcanany
@can('update map')
<x-backend.ui.button class="btn-sm" type='edit'
href="{{ route('map.edit', $map) }}"></x-backend.ui.button>
Expand Down

0 comments on commit a2f9db8

Please sign in to comment.