mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 12:24:09 +00:00
updated booking to create for current user
updated test to pass
This commit is contained in:
@@ -6,6 +6,7 @@ use Illuminate\Http\Request;
|
||||
use App\Booking;
|
||||
use App\Rate;
|
||||
use App\User;
|
||||
use Auth;
|
||||
|
||||
class BookingController extends Controller
|
||||
{
|
||||
@@ -72,7 +73,7 @@ class BookingController extends Controller
|
||||
$bia = round(($amount + ($svcharge / $rate) + 0.06), 2);
|
||||
|
||||
// return $bia;
|
||||
$user = User::first();
|
||||
$user = Auth::user();
|
||||
$booking = new Booking();
|
||||
$booking->account_name = $request->input('account_name');
|
||||
$booking->account_num = $request->input('account_num');
|
||||
@@ -86,8 +87,8 @@ class BookingController extends Controller
|
||||
$booking->term = $request->input('term');
|
||||
$booking->amount = $request->input('amount');
|
||||
$booking->rate_id = $rate;
|
||||
// $booking->user()->associate($user);
|
||||
$booking->user_id = $request->input('user_id');
|
||||
$booking->user()->associate($user);
|
||||
//$booking->user_id = $request->input('user_id');
|
||||
$booking->bia = $bia;
|
||||
$booking->save();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user