added booking list controller

This commit is contained in:
Jack Goh
2018-06-20 22:21:45 +08:00
parent bc637adcab
commit a30fd2a0b1
13 changed files with 462 additions and 191 deletions
+3 -4
View File
@@ -17,9 +17,10 @@ class BookingController extends Controller
{
public function index(){
return "hello";
$booking = Booking::where('user_id',Auth::user()->id)->get();
return $booking;
}
public function show($id)
{
$booking = Booking::where('user_id',Auth::user()->id)->where('id', $id)->first();
@@ -28,8 +29,6 @@ class BookingController extends Controller
$date2 = new DateTime();
$difference_in_seconds = ($date1->format('U') + 600) - ($date2->format('U'));
$booking->timeout = $difference_in_seconds;
if (!$booking){