base for contract system. still have more files to add.
This commit is contained in:
36
app/Http/Controllers/ContractController.php
Normal file
36
app/Http/Controllers/ContractController.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use DB;
|
||||
|
||||
//Libraries
|
||||
//use App\Library\Contracts\ContractHelper;
|
||||
|
||||
//Models
|
||||
use App\User;
|
||||
use App\Models\User\UserPermission;
|
||||
|
||||
class ContractController extends Controller
|
||||
{
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('permission:ContractAdmin');
|
||||
}
|
||||
|
||||
public function displayContracts() {
|
||||
|
||||
return view('contracts/display');
|
||||
}
|
||||
|
||||
public function displayEnterBid() {
|
||||
|
||||
return redirect('contracts/display');
|
||||
}
|
||||
|
||||
public function storeBid(Request $request) {
|
||||
|
||||
return redirect('contracts/display');
|
||||
}
|
||||
}
|
||||
17
app/Library/Contracts/Contracts.php
Normal file
17
app/Library/Contracts/Contracts.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Library\Contracts;
|
||||
|
||||
use DB;
|
||||
|
||||
use App\Models\Contracts\Contract;
|
||||
use App\Models\Contracts\Bid;
|
||||
|
||||
/**
|
||||
* This class helps deal with contracts and the bidding system
|
||||
*/
|
||||
class Contracts {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class ModifyMoonsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if(!Schema::hasTable('contracts')) {
|
||||
Schema::create('contracts', function(Blueprint $table) {
|
||||
$table->increment('id')->unique();
|
||||
$table->string('title');
|
||||
$table->date('date');
|
||||
$table->text('body');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('contract_bids')) {
|
||||
Schema::create('contract_bids', function(Blueprint $table) {
|
||||
$table->increment('id')->unique();
|
||||
$table->integer('contract_id');
|
||||
$table->decimal('bid');
|
||||
$table->boolean('accepted');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('contracts');
|
||||
Schema::dropIfExists('contract_bids');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user