diff --git a/app/Http/Controllers/ContractController.php b/app/Http/Controllers/ContractController.php index 645b93bd8..6ccf69b89 100644 --- a/app/Http/Controllers/ContractController.php +++ b/app/Http/Controllers/ContractController.php @@ -184,11 +184,11 @@ class ContractController extends Controller * Controller function to display modify bid page */ public function displayModifyBid($id) { - $contractId = $id; - - $contract = Contract::where(['contract_id' => $contractId])->get()->toArray(); + //With the bid id number, look up the bid in the database to get the contract information + $bid = Bid::where(['id' => $id])->get()->toArray(); - dd($contract); + //Retrieve the contract from the database + $contract = Contract::where(['contract_id' => $bid['contract_id']])->get()->toArray(); return view('contracts.modifybid')->with('contract', $contract); } diff --git a/resources/views/contracts/includes/public.blade.php b/resources/views/contracts/includes/public.blade.php index c14298e6f..9396d598b 100644 --- a/resources/views/contracts/includes/public.blade.php +++ b/resources/views/contracts/includes/public.blade.php @@ -25,13 +25,34 @@
| Corporation | +Amount | ++ + + @foreach($contract['bids'] as $bid) + | |
|---|---|---|---|
| {{ $bid['corporation_name'] }} | +{{ $bid['bid_amount'] }} | + @if(auth()->user()->character_id == $bid['character_id']) ++ Modify Bid + Delete Bid + | + @else ++ @endif + |
| Corporation | -Amount | -- - - @foreach($contract['bids'] as $bid) - | |
|---|---|---|---|
| {{ $bid['corporation_name'] }} | -{{ $bid['bid_amount'] }} | - @if(auth()->user()->character_id == $bid['character_id']) -- Modify Bid - Delete Bid - | - @else -- @endif - |