MIF_E31231392/app/Http/Controllers/CekStatusController.php

82 lines
1.7 KiB
PHP

<?php
namespace App\Http\Controllers;
use App\Models\BookingModel;
use Illuminate\Http\Request;
class CekStatusController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
return view('user.pages.cek_status.index');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*/
public function show(string $id)
{
$data = BookingModel::where('kode_unik', $id)->first();
if($data != null) {
return response()->json([
'status' => true,
'msg' => 'Data ditemukan (' . $id . ')',
'status_data' => $data->status_tes,
'nama_lengkap' => $data->nama_lengkap,
'kode_unik' => $data->kode_unik,
'tgl_booking' => $data->tgl_booking,
'deskripsi_tambahan' => $data->deskripsi_tambahan,
]);
} else {
return response()->json([
'status' => false,
'msg' => 'Data tidak ditemukan (' . $id . ')'
]);
}
}
/**
* Show the form for editing the specified resource.
*/
public function edit(string $id)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
//
}
}