Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/exchange into too/fixsettingvalidationbug

This commit is contained in:
weiweitoo
2018-07-11 01:43:42 +08:00
29 changed files with 119 additions and 33 deletions
+1
View File
@@ -21,5 +21,6 @@ $factory->define(App\User::class, function (Faker $faker) {
'email' => $faker->unique()->safeEmail,
'password' => $password ?: $password = bcrypt('secret'),
'remember_token' => str_random(10),
'marking' => $faker->name,
];
});
@@ -0,0 +1,31 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddMarkingToUserTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function($table)
{
$table->string('marking');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
@@ -0,0 +1,41 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class ChangeForeignkeyTypeInActivebankTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('setting_active_banks', function(Blueprint $table)
{
$table->dropForeign('setting_active_banks_x1_bank_id_foreign');
$table->foreign('x1_bank_id')
->references('acc_no')->on('setting_malaysia_banks');
$table->dropForeign('setting_active_banks_x2_bank_id_foreign');
$table->foreign('x2_bank_id')
->references('acc_no')->on('setting_malaysia_banks');
$table->dropForeign('setting_active_banks_beneficiary_id_foreign');
$table->foreign('beneficiary_id')
->references('acc_no')->on('setting_beneficiaries');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
+1 -1
View File
@@ -35,7 +35,7 @@ class BookTableSeeder extends Seeder
'rate_id' => $rate->id,
'user_id' => $user->id,
'status' => 2,
'admin_status' => 1,
'admin_status' => 2,
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
'updated_at' => Carbon::now()->format('Y-m-d H:i:s'),
]);
+4
View File
@@ -12,6 +12,8 @@ class DatabaseSeeder extends Seeder
*/
public function run()
{
Eloquent::unguard();
$this->call(UsersTableSeeder::class);
$this->call(RolesAndPermissionsSeeder::class);
$this->call(UserRoleSeeder::class);
@@ -20,8 +22,10 @@ class DatabaseSeeder extends Seeder
$this->call(SettingCreditSeeder::class);
$this->call(SuppliersTableSeeder::class);
$this->call(MarkingSeeder::class);
DB::statement('SET FOREIGN_KEY_CHECKS=0;');
$this->call(SettingMalaysiaBankSeeder::class);
$this->call(SettingBeneficiaresSeeder::class);
$this->call(SettingActiveBankSeeder::class);
DB::statement('SET FOREIGN_KEY_CHECKS=1;');
}
}
+1
View File
@@ -11,6 +11,7 @@ class MarkingSeeder extends Seeder
*/
public function run()
{
DB::table('markings')->truncate();
DB::table('markings')->insert([
'marking' => 'hehe',
'email' => 'hehe@gmail.com'
@@ -11,6 +11,7 @@ class SettingActiveBankSeeder extends Seeder
*/
public function run()
{
DB::table('setting_active_banks')->truncate();
DB::table('setting_active_banks')->insert([
'x1_bank_id' => 'malaysiaacc01',
'x2_bank_id' => 'malaysiaacc02',
@@ -11,6 +11,7 @@ class SettingBeneficiaresSeeder extends Seeder
*/
public function run()
{
DB::table('setting_beneficiaries')->truncate();
DB::table('setting_beneficiaries')->insert([
'company_name' => 'CIEF2',
'bank_name' => 'Mayban222k',
@@ -11,6 +11,8 @@ class SettingMalaysiaBankSeeder extends Seeder
*/
public function run()
{
DB::table('setting_active_banks')->truncate();
DB::table('setting_malaysia_banks')->truncate();
DB::table('setting_malaysia_banks')->insert([
'company_name' => 'CIEF',
'bank_name' => 'Maybank',
+2 -2
View File
@@ -16,8 +16,8 @@ class UsersTableSeeder extends Seeder
DB::table('users')->delete();
$users = array(
['name' => 'User', 'email' => 'user@example.com', 'password' => Hash::make('secret')],
['name' => 'Admin', 'email' => 'admin@example.com', 'password' => Hash::make('secret')],
['name' => 'User', 'marking'=> 'X9', 'email' => 'user@example.com', 'password' => Hash::make('secret')],
['name' => 'Admin', 'marking'=> 'X10', 'email' => 'admin@example.com', 'password' => Hash::make('secret')],
);
foreach ($users as $user)