fix unauthorized booking access

This commit is contained in:
Jack Goh
2018-08-16 09:52:40 +08:00
parent 232edde8e4
commit 7bbe69638c
+12 -5
View File
@@ -24,12 +24,19 @@ class BookingController extends Controller
public function index(){
$user = Auth::user();
$bookings = Booking::select('user_id', 'id', 'created_at', 'status', 'rate', 'term', 'amount', 'bia', 'verification_status')
->where('status', '=', '6')
->orwhere('status', '=', '4')
->orwhere('status', '=', '3')
->orwhere('status', '=', '2')
->orwhere('status', '=', '1')
// ->where('status', '=', '6')
// ->orwhere('status', '=', '4')
// ->orwhere('status', '=', '3')
// ->orwhere('status', '=', '2')
// ->orwhere('status', '=', '1')
->where('user_id', Auth::user()->id)
->where(function ($query) {
$query->where('status', '=', '6')
->orwhere('status', '=', '4')
->orwhere('status', '=', '3')
->orwhere('status', '=', '2')
->orwhere('status', '=', '1');
})
->orderby('updated_at','desc')
->paginate(10);