mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-21 21:34:16 +00:00
rename image_url to image_path in user_bank_slip,invoice,purchase_order
This commit is contained in:
@@ -224,14 +224,14 @@ class BookingController extends Controller
|
||||
$input['file'] = $filename;
|
||||
|
||||
$unique_name = 'bank_slip_' . md5($filename. time()); // probably not a good idea
|
||||
$unique_image_url = $unique_name. '.' .$ext;
|
||||
$unique_image_path = $unique_name. '.' .$ext;
|
||||
Storage::putFileAs(
|
||||
'user_bankslip', $bankslip_file, $unique_image_url
|
||||
'user_bankslip', $bankslip_file, $unique_image_path
|
||||
);
|
||||
|
||||
$user_bankslip = new UserBankSlip;
|
||||
$user_bankslip->booking_id = $booking->id;
|
||||
$user_bankslip->bankslip_url = $unique_image_url;
|
||||
$user_bankslip->bankslip_path = $unique_image_path;
|
||||
$user_bankslip->transfer_amount = $request->input('transfer_amount');
|
||||
$user_bankslip->save();
|
||||
|
||||
@@ -281,13 +281,13 @@ class BookingController extends Controller
|
||||
|
||||
$input['file'] = $filename;
|
||||
$unique_name = 'purchase_order_' . md5($filename. time());
|
||||
$unique_image_url = $unique_name. '.' .$ext;
|
||||
$unique_image_path = $unique_name. '.' .$ext;
|
||||
Storage::putFileAs(
|
||||
'purchase_order',/*folder name*/ $user_input_file, $unique_image_url
|
||||
'purchase_order',/*folder name*/ $user_input_file, $unique_image_path
|
||||
);
|
||||
|
||||
$user_po = new PurchaseOrder;
|
||||
$user_po->image_url = $unique_image_url;
|
||||
$user_po->image_path = $unique_image_path;
|
||||
$user_po->book_id = $booking->id;
|
||||
$user_po->amount = $request->input('amount');
|
||||
$user_po->save();
|
||||
@@ -437,7 +437,7 @@ class BookingController extends Controller
|
||||
}
|
||||
|
||||
$validator = Validator::make($request->all(), [
|
||||
'invoice_url' => 'mimes:jpg,jpeg,bmp,png,pdf,doc,docx'
|
||||
'invoice_path' => 'mimes:jpg,jpeg,bmp,png,pdf,doc,docx'
|
||||
]);
|
||||
|
||||
if($validator->fails())
|
||||
@@ -445,7 +445,7 @@ class BookingController extends Controller
|
||||
return response()->json(['message'=>'Incorrect format'],200);
|
||||
}
|
||||
|
||||
if(!$input_file = $request->file('invoice_url'))
|
||||
if(!$input_file = $request->file('invoice_path'))
|
||||
{
|
||||
return response()->json(['message'=>'No file detected'], 400);
|
||||
}
|
||||
@@ -454,7 +454,7 @@ class BookingController extends Controller
|
||||
$filename = $input_file->getClientOriginalName();
|
||||
$ext = $input_file->getClientOriginalExtension();
|
||||
|
||||
$input['invoice_url'] = $filename;
|
||||
$input['invoice_path'] = $filename;
|
||||
$unique_name = 'invoice' . md5($filename. time());
|
||||
$unique_file_url = $unique_name. '.' .$ext;
|
||||
Storage::putFileAs(
|
||||
@@ -462,7 +462,7 @@ class BookingController extends Controller
|
||||
);
|
||||
|
||||
$invoice = new Invoice;
|
||||
$invoice->invoice_url = $unique_file_url;
|
||||
$invoice->invoice_path = $unique_file_url;
|
||||
$invoice->amount = $request->input('amount');
|
||||
$invoice->booking_id = $booking->id;
|
||||
$invoice->save();
|
||||
|
||||
Reference in New Issue
Block a user