mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 12:24:09 +00:00
added get one booking function in controller
update routes with booking id pramas fixed not found routes fixed count down with real data moved bookings routes into autenticated route
This commit is contained in:
@@ -11,10 +11,29 @@ use App\UserBankSlip;
|
||||
use App\User;
|
||||
use Auth;
|
||||
use Validator;
|
||||
use DateTime;
|
||||
|
||||
class BookingController extends Controller
|
||||
{
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$booking = Booking::where('user_id',Auth::user()->id)->where('id', $id)->first();
|
||||
|
||||
$date1 = new DateTime($booking->created_at);
|
||||
$date2 = new DateTime();
|
||||
$difference_in_seconds = ($date1->format('U') + 60) - ($date2->format('U'));
|
||||
|
||||
|
||||
|
||||
$booking->timeout = $difference_in_seconds;
|
||||
|
||||
if (!$booking){
|
||||
return response()->json(['success'=>false, 'message'=>'not found'], 404);
|
||||
}
|
||||
return $booking;
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$rates = Rate::orderby('updated_at','desc')->first();
|
||||
|
||||
Reference in New Issue
Block a user