created new button for adding new contracts on admin dashboard for contracts
This commit is contained in:
@@ -154,20 +154,42 @@ class ContractController extends Controller
|
|||||||
'contract_id' => $request->contract_id,
|
'contract_id' => $request->contract_id,
|
||||||
])->delete();
|
])->delete();
|
||||||
|
|
||||||
return redirect('contracts/display/public')->with('success', 'Bid deleted.');
|
return redirect('/contracts/display/public')->with('success', 'Bid deleted.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Controller function to display modify bid page
|
* Controller function to display modify bid page
|
||||||
*/
|
*/
|
||||||
public function displayModifyBid(Request $request) {
|
public function displayModifyBid($id) {
|
||||||
|
$contract_id = $id;
|
||||||
|
|
||||||
|
return view('contracts.modifybid')->with('contract_id', $contract_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Controller function to modify a bid
|
* Controller function to modify a bid
|
||||||
*/
|
*/
|
||||||
public function modifyBid(Request $request) {
|
public function modifyBid(Request $request) {
|
||||||
|
$this->validate($request, [
|
||||||
|
'bid_amount',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$type = $request->type;
|
||||||
|
$contractId = $request->contract_id;
|
||||||
|
$bidAmount = $request->bid_amount;
|
||||||
|
|
||||||
|
Bid::where([
|
||||||
|
'character_id' => auth()->user()->getId(),
|
||||||
|
'contract_id' => $contractId,
|
||||||
|
])->update([
|
||||||
|
'bid_amount' => $bidAmount,
|
||||||
|
]);
|
||||||
|
|
||||||
|
if($type == 'public') {
|
||||||
|
return redirect('/contracts/display/public')->with('success', 'Bid modified.');
|
||||||
|
} else {
|
||||||
|
return redirect('/contracts/display/private')->with('success', 'Bid modified');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
@extends('layouts.b4')
|
@extends('layouts.b4')
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h2>Contract Dashboard</h2>
|
<div class="row justify-content-center">
|
||||||
|
<h2>Contract Dashboard</h2>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
<button href="{{ route('/contracts/admin/new') }}" type="button" class="btn btn-primary">Create New Contract</button>
|
||||||
|
<br>
|
||||||
@if(count($contracts))
|
@if(count($contracts))
|
||||||
@foreach($contracts as $contract)
|
@foreach($contracts as $contract)
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|||||||
Reference in New Issue
Block a user