Fix some error due to update migration

This commit is contained in:
Too
2018-06-28 16:11:49 +08:00
parent 81a5a46d36
commit 63dce18675
14 changed files with 170 additions and 28 deletions
@@ -14,7 +14,7 @@ class ChinaBankSlipController extends Controller
public function store(Request $request, $id)
{
$booking = Booking::where('id',$id)->firstOrFail();
// TODO : put this after check file exist
// validate file format
$validator = Validator::make($request->all(), [
@@ -26,7 +26,6 @@ class ChinaBankSlipController extends Controller
return response()->json(['message'=>'Incorrect format'],200);
}
$validator = Validator::make($request->all(), [
'china_bank_slips' => 'max:3072'
]);
@@ -36,7 +35,6 @@ class ChinaBankSlipController extends Controller
return response()->json(['message'=>'Image too large, upload files up to 3 MB'], 400);
}
if($bankslip_file = $request->file('file')){
$filename = $bankslip_file->getClientOriginalName();
@@ -53,7 +51,7 @@ class ChinaBankSlipController extends Controller
} else {
return response()->json(['message'=>'file not found'],200);
}
$china_bankslip = new ChinaBankSlip;
$china_bankslip->booking_id = $booking->id;
$china_bankslip->china_bank_slip_path = $upload_path;