@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use App\SystemCategories; |
| 6 | 6 | use Faker\Generator as Faker; |
| 7 | 7 | |
| 8 | -$factory->define(SystemCategories::class, function (Faker $faker) { |
|
| 8 | +$factory->define(SystemCategories::class, function(Faker $faker) { |
|
| 9 | 9 | return [ |
| 10 | 10 | 'name' => $faker->unique()->text(15) |
| 11 | 11 | ]; |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use App\CustomerNotes; |
| 6 | 6 | use Faker\Generator as Faker; |
| 7 | 7 | |
| 8 | -$factory->define(CustomerNotes::class, function (Faker $faker) { |
|
| 8 | +$factory->define(CustomerNotes::class, function(Faker $faker) { |
|
| 9 | 9 | return [ |
| 10 | 10 | 'cust_id' => factory(App\Customers::class)->create()->cust_id, |
| 11 | 11 | 'user_id' => factory(App\User::class)->create()->user_id, |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use App\TechTipComments; |
| 6 | 6 | use Faker\Generator as Faker; |
| 7 | 7 | |
| 8 | -$factory->define(TechTipComments::class, function (Faker $faker) { |
|
| 8 | +$factory->define(TechTipComments::class, function(Faker $faker) { |
|
| 9 | 9 | return [ |
| 10 | 10 | 'tip_id' => factory(App\TechTips::class)->create()->tip_id, |
| 11 | 11 | 'user_id' => factory(App\User::class)->create()->user_id, |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use App\TechTipTypes; |
| 6 | 6 | use Faker\Generator as Faker; |
| 7 | 7 | |
| 8 | -$factory->define(TechTipTypes::class, function (Faker $faker) { |
|
| 8 | +$factory->define(TechTipTypes::class, function(Faker $faker) { |
|
| 9 | 9 | return [ |
| 10 | 10 | 'description' => $faker->catchPhrase, |
| 11 | 11 | ]; |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use App\CustomerFiles; |
| 6 | 6 | use Faker\Generator as Faker; |
| 7 | 7 | |
| 8 | -$factory->define(CustomerFiles::class, function (Faker $faker) { |
|
| 8 | +$factory->define(CustomerFiles::class, function(Faker $faker) { |
|
| 9 | 9 | return [ |
| 10 | 10 | 'file_id' => factory(App\Files::class)->create()->file_id, |
| 11 | 11 | 'file_type_id' => factory(App\CustomerFileTypes::class)->create()->file_type_id, |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use App\SystemDataFieldTypes; |
| 6 | 6 | use Faker\Generator as Faker; |
| 7 | 7 | |
| 8 | -$factory->define(SystemDataFieldTypes::class, function (Faker $faker) { |
|
| 8 | +$factory->define(SystemDataFieldTypes::class, function(Faker $faker) { |
|
| 9 | 9 | return [ |
| 10 | 10 | 'name' => $faker->words(3, true), |
| 11 | 11 | 'hidden' => 0 |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('failed_jobs', function (Blueprint $table) { |
|
| 16 | + Schema::create('failed_jobs', function(Blueprint $table) { |
|
| 17 | 17 | $table->bigIncrements('id'); |
| 18 | 18 | $table->text('connection'); |
| 19 | 19 | $table->text('queue'); |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | public function up() |
| 16 | 16 | { |
| 17 | - Schema::create('user_role_permissions', function (Blueprint $table) { |
|
| 17 | + Schema::create('user_role_permissions', function(Blueprint $table) { |
|
| 18 | 18 | $table->increments('id'); |
| 19 | 19 | $table->integer('role_id')->unsigned(); |
| 20 | 20 | $table->integer('perm_type_id')->unsigned(); |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | public function up() |
| 18 | 18 | { |
| 19 | - Schema::create('user_role_types', function (Blueprint $table) { |
|
| 19 | + Schema::create('user_role_types', function(Blueprint $table) { |
|
| 20 | 20 | $table->increments('role_id'); |
| 21 | 21 | $table->text('name'); |
| 22 | 22 | $table->text('description'); |
@@ -26,10 +26,10 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | // Insert default data |
| 28 | 28 | DB::table('user_role_types')->insert([ |
| 29 | - ['role_id' => 1, 'name' => 'Installer', 'description' => 'All Access Administrator', 'allow_edit' => 0, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
| 30 | - ['role_id' => 2, 'name' => 'Administrator', 'description' => 'System Administrator', 'allow_edit' => 0, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
| 31 | - ['role_id' => 3, 'name' => 'Reports', 'description' => 'User who can run reports', 'allow_edit' => 0, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
| 32 | - ['role_id' => 4, 'name' => 'Tech', 'description' => 'Standard User', 'allow_edit' => 0, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
| 29 | + ['role_id' => 1, 'name' => 'Installer', 'description' => 'All Access Administrator', 'allow_edit' => 0, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
| 30 | + ['role_id' => 2, 'name' => 'Administrator', 'description' => 'System Administrator', 'allow_edit' => 0, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
| 31 | + ['role_id' => 3, 'name' => 'Reports', 'description' => 'User who can run reports', 'allow_edit' => 0, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
| 32 | + ['role_id' => 4, 'name' => 'Tech', 'description' => 'Standard User', 'allow_edit' => 0, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
| 33 | 33 | ]); |
| 34 | 34 | |
| 35 | 35 | // Update the users table to include the 'user_role' column |
@@ -35,8 +35,7 @@ |
||
| 35 | 35 | // Update the users table to include the 'user_role' column |
| 36 | 36 | if(!Schema::hasColumn('users', 'role_id')) |
| 37 | 37 | { |
| 38 | - Schema::table('users', function(Blueprint $table) |
|
| 39 | - { |
|
| 38 | + Schema::table('users', function(Blueprint $table) { |
|
| 40 | 39 | $table->integer('role_id')->unsigned()->after('user_id')->default(4); |
| 41 | 40 | $table->foreign('role_id')->references('role_id')->on('user_role_types')->onUpdate('cascade'); |
| 42 | 41 | }); |