rename book_id in po table to booking_id to perform ORM relantionship

added relationship between booking and po
updated settings shows for different role
added function to display po for admin
This commit is contained in:
Jack Goh
2018-06-28 10:06:26 +08:00
parent 9432cdaaad
commit 2b4ddadfcb
7 changed files with 110 additions and 46 deletions
@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RenameBookingForeignkeyInPoTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('purchase_orders', function($table)
{
$table->dropForeign('book_id');
$table->integer('booking_id')->unsigned();
$table->foreign('booking_id')->references('id')->on('bookings');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}