Completed
Push — master ( 77fab1...782f26 )
by Sherif
01:58
created
src/Modules/Users/Database/Seeds/UsersTableSeeder.php 2 patches
Indentation   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -8,111 +8,111 @@
 block discarded – undo
8 8
 
9 9
 class UsersTableSeeder extends Seeder
10 10
 {
11
-    /**
12
-     * Run the database seeds.
13
-     *
14
-     * @return void
15
-     */
16
-    public function run()
17
-    {
18
-        /**
19
-         * Create Default roles.
20
-         */
21
-        $role = Role::updateOrInsert([
22
-            'name' => 'Admin',
23
-        ],[
24
-            'created_at' => \DB::raw('NOW()'),
25
-            'updated_at' => \DB::raw('NOW()')
26
-        ]);
11
+	/**
12
+	 * Run the database seeds.
13
+	 *
14
+	 * @return void
15
+	 */
16
+	public function run()
17
+	{
18
+		/**
19
+		 * Create Default roles.
20
+		 */
21
+		$role = Role::updateOrInsert([
22
+			'name' => 'Admin',
23
+		],[
24
+			'created_at' => \DB::raw('NOW()'),
25
+			'updated_at' => \DB::raw('NOW()')
26
+		]);
27 27
 
28
-        /**
29
-         * Create Default user.
30
-         */
31
-        AclUser::updateOrInsert([
32
-            'email' => '[email protected]',
33
-        ],[
34
-            'name'       => 'Admin',
35
-            'password'   => bcrypt('123456'),
36
-            'confirmed'  => 1,
37
-            'created_at' => \DB::raw('NOW()'),
38
-            'updated_at' => \DB::raw('NOW()')
39
-        ]);
28
+		/**
29
+		 * Create Default user.
30
+		 */
31
+		AclUser::updateOrInsert([
32
+			'email' => '[email protected]',
33
+		],[
34
+			'name'       => 'Admin',
35
+			'password'   => bcrypt('123456'),
36
+			'confirmed'  => 1,
37
+			'created_at' => \DB::raw('NOW()'),
38
+			'updated_at' => \DB::raw('NOW()')
39
+		]);
40 40
 
41
-        /**
42
-         * Insert the permissions related to users table.
43
-         */
44
-        \DB::table('permissions')->insert(
45
-            [
46
-                /**
47
-                 * Users model permissions.
48
-                 */
49
-                [
50
-                'name'       => 'index',
51
-                'model'      => 'user',
52
-                'created_at' => \DB::raw('NOW()'),
53
-                'updated_at' => \DB::raw('NOW()')
54
-                ],
55
-                [
56
-                'name'       => 'find',
57
-                'model'      => 'user',
58
-                'created_at' => \DB::raw('NOW()'),
59
-                'updated_at' => \DB::raw('NOW()')
60
-                ],
61
-                [
62
-                'name'       => 'insert',
63
-                'model'      => 'user',
64
-                'created_at' => \DB::raw('NOW()'),
65
-                'updated_at' => \DB::raw('NOW()')
66
-                ],
67
-                [
68
-                'name'       => 'update',
69
-                'model'      => 'user',
70
-                'created_at' => \DB::raw('NOW()'),
71
-                'updated_at' => \DB::raw('NOW()')
72
-                ],
73
-                [
74
-                'name'       => 'delete',
75
-                'model'      => 'user',
76
-                'created_at' => \DB::raw('NOW()'),
77
-                'updated_at' => \DB::raw('NOW()')
78
-                ],
79
-                [
80
-                'name'       => 'deleted',
81
-                'model'      => 'user',
82
-                'created_at' => \DB::raw('NOW()'),
83
-                'updated_at' => \DB::raw('NOW()')
84
-                ],
85
-                [
86
-                'name'       => 'restore',
87
-                'model'      => 'user',
88
-                'created_at' => \DB::raw('NOW()'),
89
-                'updated_at' => \DB::raw('NOW()')
90
-                ],
91
-                [
92
-                'name'       => 'assignRoles',
93
-                'model'      => 'user',
94
-                'created_at' => \DB::raw('NOW()'),
95
-                'updated_at' => \DB::raw('NOW()')
96
-                ],
97
-                [
98
-                'name'       => 'block',
99
-                'model'      => 'user',
100
-                'created_at' => \DB::raw('NOW()'),
101
-                'updated_at' => \DB::raw('NOW()')
102
-                ],
103
-                [
104
-                'name'       => 'unblock',
105
-                'model'      => 'user',
106
-                'created_at' => \DB::raw('NOW()'),
107
-                'updated_at' => \DB::raw('NOW()')
108
-                ],
109
-                [
110
-                'name'       => 'role',
111
-                'model'      => 'user',
112
-                'created_at' => \DB::raw('NOW()'),
113
-                'updated_at' => \DB::raw('NOW()')
114
-                ]
115
-            ]
116
-        );
117
-    }
41
+		/**
42
+		 * Insert the permissions related to users table.
43
+		 */
44
+		\DB::table('permissions')->insert(
45
+			[
46
+				/**
47
+				 * Users model permissions.
48
+				 */
49
+				[
50
+				'name'       => 'index',
51
+				'model'      => 'user',
52
+				'created_at' => \DB::raw('NOW()'),
53
+				'updated_at' => \DB::raw('NOW()')
54
+				],
55
+				[
56
+				'name'       => 'find',
57
+				'model'      => 'user',
58
+				'created_at' => \DB::raw('NOW()'),
59
+				'updated_at' => \DB::raw('NOW()')
60
+				],
61
+				[
62
+				'name'       => 'insert',
63
+				'model'      => 'user',
64
+				'created_at' => \DB::raw('NOW()'),
65
+				'updated_at' => \DB::raw('NOW()')
66
+				],
67
+				[
68
+				'name'       => 'update',
69
+				'model'      => 'user',
70
+				'created_at' => \DB::raw('NOW()'),
71
+				'updated_at' => \DB::raw('NOW()')
72
+				],
73
+				[
74
+				'name'       => 'delete',
75
+				'model'      => 'user',
76
+				'created_at' => \DB::raw('NOW()'),
77
+				'updated_at' => \DB::raw('NOW()')
78
+				],
79
+				[
80
+				'name'       => 'deleted',
81
+				'model'      => 'user',
82
+				'created_at' => \DB::raw('NOW()'),
83
+				'updated_at' => \DB::raw('NOW()')
84
+				],
85
+				[
86
+				'name'       => 'restore',
87
+				'model'      => 'user',
88
+				'created_at' => \DB::raw('NOW()'),
89
+				'updated_at' => \DB::raw('NOW()')
90
+				],
91
+				[
92
+				'name'       => 'assignRoles',
93
+				'model'      => 'user',
94
+				'created_at' => \DB::raw('NOW()'),
95
+				'updated_at' => \DB::raw('NOW()')
96
+				],
97
+				[
98
+				'name'       => 'block',
99
+				'model'      => 'user',
100
+				'created_at' => \DB::raw('NOW()'),
101
+				'updated_at' => \DB::raw('NOW()')
102
+				],
103
+				[
104
+				'name'       => 'unblock',
105
+				'model'      => 'user',
106
+				'created_at' => \DB::raw('NOW()'),
107
+				'updated_at' => \DB::raw('NOW()')
108
+				],
109
+				[
110
+				'name'       => 'role',
111
+				'model'      => 'user',
112
+				'created_at' => \DB::raw('NOW()'),
113
+				'updated_at' => \DB::raw('NOW()')
114
+				]
115
+			]
116
+		);
117
+	}
118 118
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
          */
21 21
         $role = Role::updateOrInsert([
22 22
             'name' => 'Admin',
23
-        ],[
23
+        ], [
24 24
             'created_at' => \DB::raw('NOW()'),
25 25
             'updated_at' => \DB::raw('NOW()')
26 26
         ]);
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
          */
31 31
         AclUser::updateOrInsert([
32 32
             'email' => '[email protected]',
33
-        ],[
33
+        ], [
34 34
             'name'       => 'Admin',
35 35
             'password'   => bcrypt('123456'),
36 36
             'confirmed'  => 1,
Please login to merge, or discard this patch.
src/Modules/Users/Database/Seeds/AssignRelationsSeeder.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -6,27 +6,27 @@
 block discarded – undo
6 6
 
7 7
 class AssignRelationsSeeder extends Seeder
8 8
 {
9
-    /**
10
-     * Run the database seeds.
11
-     *
12
-     * @return void
13
-     */
14
-    public function run()
15
-    {
16
-        $adminRoleId = \DB::table('roles')->where('name', 'admin')->select('id')->first()->id;
9
+	/**
10
+	 * Run the database seeds.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function run()
15
+	{
16
+		$adminRoleId = \DB::table('roles')->where('name', 'admin')->select('id')->first()->id;
17 17
 
18
-        /**
19
-         * Assign the permissions to the admin role.
20
-         */
21
-        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['user'])->each(function ($permission) use ($adminRoleId) {
22
-            \DB::table('roles_permissions')->insert(
23
-                [
24
-                'permission_id' => $permission->id,
25
-                'role_id'       => $adminRoleId,
26
-                'created_at'    => \DB::raw('NOW()'),
27
-                'updated_at'    => \DB::raw('NOW()')
28
-                ]
29
-            );
30
-        });
31
-    }
18
+		/**
19
+		 * Assign the permissions to the admin role.
20
+		 */
21
+		\DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['user'])->each(function ($permission) use ($adminRoleId) {
22
+			\DB::table('roles_permissions')->insert(
23
+				[
24
+				'permission_id' => $permission->id,
25
+				'role_id'       => $adminRoleId,
26
+				'created_at'    => \DB::raw('NOW()'),
27
+				'updated_at'    => \DB::raw('NOW()')
28
+				]
29
+			);
30
+		});
31
+	}
32 32
 }
Please login to merge, or discard this patch.
src/Modules/Users/Database/Migrations/2015_12_20_124153_users.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -5,37 +5,37 @@
 block discarded – undo
5 5
 
6 6
 class Users extends Migration
7 7
 {
8
-    /**
9
-     * Run the migrations.
10
-     *
11
-     * @return void
12
-     */
13
-    public function up()
14
-    {
15
-        Schema::create('users', function (Blueprint $table) {
16
-            $table->increments('id');
17
-            $table->string('profile_picture', 150)->nullable();
18
-            $table->string('name', 100)->nullable();
19
-            $table->string('email')->unique();
20
-            $table->string('password', 60)->nullable();
21
-            $table->boolean('blocked')->default(0);
22
-            $table->boolean('confirmed')->default(0);
23
-            $table->string('confirmation_code')->nullable();
24
-            $table->string('locale', 2)->default('en');
25
-            $table->string('timezone', 50)->default('Africa/Cairo');
26
-            $table->softDeletes();
27
-            $table->rememberToken();
28
-            $table->timestamps();
29
-        });
30
-    }
8
+	/**
9
+	 * Run the migrations.
10
+	 *
11
+	 * @return void
12
+	 */
13
+	public function up()
14
+	{
15
+		Schema::create('users', function (Blueprint $table) {
16
+			$table->increments('id');
17
+			$table->string('profile_picture', 150)->nullable();
18
+			$table->string('name', 100)->nullable();
19
+			$table->string('email')->unique();
20
+			$table->string('password', 60)->nullable();
21
+			$table->boolean('blocked')->default(0);
22
+			$table->boolean('confirmed')->default(0);
23
+			$table->string('confirmation_code')->nullable();
24
+			$table->string('locale', 2)->default('en');
25
+			$table->string('timezone', 50)->default('Africa/Cairo');
26
+			$table->softDeletes();
27
+			$table->rememberToken();
28
+			$table->timestamps();
29
+		});
30
+	}
31 31
 
32
-    /**
33
-     * Reverse the migrations.
34
-     *
35
-     * @return void
36
-     */
37
-    public function down()
38
-    {
39
-        Schema::dropIfExists('users');
40
-    }
32
+	/**
33
+	 * Reverse the migrations.
34
+	 *
35
+	 * @return void
36
+	 */
37
+	public function down()
38
+	{
39
+		Schema::dropIfExists('users');
40
+	}
41 41
 }
Please login to merge, or discard this patch.
src/Modules/Roles/Database/Seeds/RolesTableSeeder.php 2 patches
Indentation   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -8,80 +8,80 @@
 block discarded – undo
8 8
 
9 9
 class RolesTableSeeder extends Seeder
10 10
 {
11
-    /**
12
-     * Run the database seeds.
13
-     *
14
-     * @return void
15
-     */
16
-    public function run()
17
-    {        
18
-        /**
19
-         * Assign default users to admin roles.
20
-         */
21
-        $adminRoleId = Role::where('name', 'Admin')->select('id')->first()->id;;
22
-        $adminUserId = AclUser::where('email', '[email protected]')->select('id')->first()->id;
23
-        \DB::table('users_roles')->updateOrInsert([
24
-            'user_id' => $adminUserId,
25
-            'role_id' => $adminRoleId,
26
-        ],[]);
11
+	/**
12
+	 * Run the database seeds.
13
+	 *
14
+	 * @return void
15
+	 */
16
+	public function run()
17
+	{        
18
+		/**
19
+		 * Assign default users to admin roles.
20
+		 */
21
+		$adminRoleId = Role::where('name', 'Admin')->select('id')->first()->id;;
22
+		$adminUserId = AclUser::where('email', '[email protected]')->select('id')->first()->id;
23
+		\DB::table('users_roles')->updateOrInsert([
24
+			'user_id' => $adminUserId,
25
+			'role_id' => $adminRoleId,
26
+		],[]);
27 27
 
28
-        /**
29
-         * Insert the permissions related to roles table.
30
-         */
31
-        \DB::table('permissions')->insert(
32
-            [
33
-                /**
34
-                 * Roles model permissions.
35
-                 */
36
-                [
37
-                'name'       => 'index',
38
-                'model'      => 'role',
39
-                'created_at' => \DB::raw('NOW()'),
40
-                'updated_at' => \DB::raw('NOW()')
41
-                ],
42
-                [
43
-                'name'       => 'find',
44
-                'model'      => 'role',
45
-                'created_at' => \DB::raw('NOW()'),
46
-                'updated_at' => \DB::raw('NOW()')
47
-                ],
48
-                [
49
-                'name'       => 'insert',
50
-                'model'      => 'role',
51
-                'created_at' => \DB::raw('NOW()'),
52
-                'updated_at' => \DB::raw('NOW()')
53
-                ],
54
-                [
55
-                'name'       => 'update',
56
-                'model'      => 'role',
57
-                'created_at' => \DB::raw('NOW()'),
58
-                'updated_at' => \DB::raw('NOW()')
59
-                ],
60
-                [
61
-                'name'       => 'delete',
62
-                'model'      => 'role',
63
-                'created_at' => \DB::raw('NOW()'),
64
-                'updated_at' => \DB::raw('NOW()')
65
-                ],
66
-                [
67
-                'name'       => 'deleted',
68
-                'model'      => 'role',
69
-                'created_at' => \DB::raw('NOW()'),
70
-                'updated_at' => \DB::raw('NOW()')
71
-                ],
72
-                [
73
-                'name'       => 'restore',
74
-                'model'      => 'role',
75
-                'created_at' => \DB::raw('NOW()'),
76
-                'updated_at' => \DB::raw('NOW()')
77
-                ],
78
-                [
79
-                'name'       => 'assignPermissions',
80
-                'model'      => 'role',
81
-                'created_at' => \DB::raw('NOW()'),
82
-                'updated_at' => \DB::raw('NOW()')
83
-                ],
84
-            ]
85
-        );
86
-    }
28
+		/**
29
+		 * Insert the permissions related to roles table.
30
+		 */
31
+		\DB::table('permissions')->insert(
32
+			[
33
+				/**
34
+				 * Roles model permissions.
35
+				 */
36
+				[
37
+				'name'       => 'index',
38
+				'model'      => 'role',
39
+				'created_at' => \DB::raw('NOW()'),
40
+				'updated_at' => \DB::raw('NOW()')
41
+				],
42
+				[
43
+				'name'       => 'find',
44
+				'model'      => 'role',
45
+				'created_at' => \DB::raw('NOW()'),
46
+				'updated_at' => \DB::raw('NOW()')
47
+				],
48
+				[
49
+				'name'       => 'insert',
50
+				'model'      => 'role',
51
+				'created_at' => \DB::raw('NOW()'),
52
+				'updated_at' => \DB::raw('NOW()')
53
+				],
54
+				[
55
+				'name'       => 'update',
56
+				'model'      => 'role',
57
+				'created_at' => \DB::raw('NOW()'),
58
+				'updated_at' => \DB::raw('NOW()')
59
+				],
60
+				[
61
+				'name'       => 'delete',
62
+				'model'      => 'role',
63
+				'created_at' => \DB::raw('NOW()'),
64
+				'updated_at' => \DB::raw('NOW()')
65
+				],
66
+				[
67
+				'name'       => 'deleted',
68
+				'model'      => 'role',
69
+				'created_at' => \DB::raw('NOW()'),
70
+				'updated_at' => \DB::raw('NOW()')
71
+				],
72
+				[
73
+				'name'       => 'restore',
74
+				'model'      => 'role',
75
+				'created_at' => \DB::raw('NOW()'),
76
+				'updated_at' => \DB::raw('NOW()')
77
+				],
78
+				[
79
+				'name'       => 'assignPermissions',
80
+				'model'      => 'role',
81
+				'created_at' => \DB::raw('NOW()'),
82
+				'updated_at' => \DB::raw('NOW()')
83
+				],
84
+			]
85
+		);
86
+	}
87 87
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,12 +18,12 @@
 block discarded – undo
18 18
         /**
19 19
          * Assign default users to admin roles.
20 20
          */
21
-        $adminRoleId = Role::where('name', 'Admin')->select('id')->first()->id;;
21
+        $adminRoleId = Role::where('name', 'Admin')->select('id')->first()->id; ;
22 22
         $adminUserId = AclUser::where('email', '[email protected]')->select('id')->first()->id;
23 23
         \DB::table('users_roles')->updateOrInsert([
24 24
             'user_id' => $adminUserId,
25 25
             'role_id' => $adminRoleId,
26
-        ],[]);
26
+        ], []);
27 27
 
28 28
         /**
29 29
          * Insert the permissions related to roles table.
Please login to merge, or discard this patch.
src/Modules/Roles/Database/Migrations/2015_12_22_145819_roles.php 2 patches
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -5,40 +5,40 @@
 block discarded – undo
5 5
 
6 6
 class Roles extends Migration
7 7
 {
8
-    /**
9
-     * Run the migrations.
10
-     *
11
-     * @return void
12
-     */
13
-    public function up()
14
-    {
15
-        Schema::create('roles', function (Blueprint $table) {
16
-            $table->increments('id');
17
-            $table->string('name', 100)->unique();
18
-            $table->softDeletes();
19
-            $table->timestamps();
20
-        });
8
+	/**
9
+	 * Run the migrations.
10
+	 *
11
+	 * @return void
12
+	 */
13
+	public function up()
14
+	{
15
+		Schema::create('roles', function (Blueprint $table) {
16
+			$table->increments('id');
17
+			$table->string('name', 100)->unique();
18
+			$table->softDeletes();
19
+			$table->timestamps();
20
+		});
21 21
         
22
-        Schema::create('users_roles', function (Blueprint $table) {
23
-            $table->increments('id');
24
-            $table->unsignedInteger('user_id');
25
-            $table->unsignedInteger('role_id');
26
-            $table->softDeletes();
27
-            $table->timestamps();
22
+		Schema::create('users_roles', function (Blueprint $table) {
23
+			$table->increments('id');
24
+			$table->unsignedInteger('user_id');
25
+			$table->unsignedInteger('role_id');
26
+			$table->softDeletes();
27
+			$table->timestamps();
28 28
 
29
-            $table->foreign('user_id')->references('id')->on('users');
30
-            $table->foreign('role_id')->references('id')->on('roles');
31
-        });
32
-    }
29
+			$table->foreign('user_id')->references('id')->on('users');
30
+			$table->foreign('role_id')->references('id')->on('roles');
31
+		});
32
+	}
33 33
 
34
-    /**
35
-     * Reverse the migrations.
36
-     *
37
-     * @return void
38
-     */
39
-    public function down()
40
-    {
41
-        Schema::dropIfExists('roles');
42
-        Schema::dropIfExists('users_roles');
43
-    }
34
+	/**
35
+	 * Reverse the migrations.
36
+	 *
37
+	 * @return void
38
+	 */
39
+	public function down()
40
+	{
41
+		Schema::dropIfExists('roles');
42
+		Schema::dropIfExists('users_roles');
43
+	}
44 44
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,14 +12,14 @@
 block discarded – undo
12 12
      */
13 13
     public function up()
14 14
     {
15
-        Schema::create('roles', function (Blueprint $table) {
15
+        Schema::create('roles', function(Blueprint $table) {
16 16
             $table->increments('id');
17 17
             $table->string('name', 100)->unique();
18 18
             $table->softDeletes();
19 19
             $table->timestamps();
20 20
         });
21 21
         
22
-        Schema::create('users_roles', function (Blueprint $table) {
22
+        Schema::create('users_roles', function(Blueprint $table) {
23 23
             $table->increments('id');
24 24
             $table->unsignedInteger('user_id');
25 25
             $table->unsignedInteger('role_id');
Please login to merge, or discard this patch.