|
|
@@ -4,8 +4,10 @@ namespace App\Http\Controllers;
|
|
|
|
|
|
use App\Models\CheckIn;
|
|
|
use App\Models\User;
|
|
|
+use Illuminate\Http\Request;
|
|
|
use App\Http\Requests\StoreCheckInRequest;
|
|
|
use App\Http\Requests\UpdateCheckInRequest;
|
|
|
+use App\Models\Department;
|
|
|
|
|
|
class CheckInController extends Controller
|
|
|
{
|
|
|
@@ -65,9 +67,16 @@ class CheckInController extends Controller
|
|
|
* @param \App\Models\CheckIn $checkIn
|
|
|
* @return \Illuminate\Http\Response
|
|
|
*/
|
|
|
- public function show(CheckIn $checkIn)
|
|
|
+ public function show(Request $request, CheckIn $checkIn)
|
|
|
{
|
|
|
//
|
|
|
+ $checkIn = CheckIn::where('user_id', '=', $request->id)->where('activity_id', '=', $request->activity_id)->first();
|
|
|
+ $department = Department::where('department_id', '=', $checkIn->department_id)->first();
|
|
|
+ $checkIn->department = $department->department_name;
|
|
|
+ $response = [
|
|
|
+ 'checkIn' => $checkIn,
|
|
|
+ ];
|
|
|
+ return response($response, 201);
|
|
|
}
|
|
|
|
|
|
/**
|