changed the listing function on contacts frontend, still got issues

This commit is contained in:
Aqeeb Imtiaz Harun
2018-07-06 18:05:12 +08:00
parent 5412e1aa50
commit 1759b088a3
10 changed files with 269 additions and 150 deletions
@@ -63,5 +63,16 @@ class LaratrustSetupTeams extends Migration
*/
public function down()
{
Schema::dropIfExists('teams');
Schema::table('role_user', function (Blueprint $table) {
$table->dropForeign('role_user_role_id_foreign');
$table->dropForeign('role_user_team_id_foreign');
});
Schema::table('permission_user', function (Blueprint $table) {
$table->dropForeign('permission_user_permission_id_foreign');
$table->dropForeign('permission_user_team_id_foreign');
});
}
}
@@ -15,18 +15,17 @@ class CreateContactsTable extends Migration
{
Schema::create('contacts', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->foreign('user_id')
$table->integer('user_id')->unsigned();
$table->foreign('user_id')
->references('id')->on('users')
->onDelete('cascade');
//$table->unsignedInteger('user_id');
// $table->foreign('user_id')->references('id')->on('users');
$table->integer('company_id')->unsigned();
$table->foreign('company_id')
->references('id')->on('companies')
->onDelete('cascade');
$table->Integer('status')->default('0');
$table->timestamps();
});
@@ -0,0 +1,47 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class ChangeUserIdAndComIdInContacts extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('contacts', function (Blueprint $table) {
//
$table->dropForeign('contacts_user_id_foreign');
$table->integer('sender_id')->unsigned();
$table->foreign('sender_id')
->references('id')->on('companies')
->onDelete('cascade');
$table->dropForeign('contacts_company_id_foreign');
$table->integer('recipient_id')->unsigned();
$table->foreign('recipient_id')
->references('id')->on('companies')
->onDelete('cascade');
$table->dropColumn('user_id');
$table->dropColumn('com_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('contacts', function (Blueprint $table) {
//
});
}
}