Completed
Push — master ( fed21d...0c3b23 )
by Sherif
10:50
created
src/Modules/Reporting/Repositories/ReportRepository.php 2 patches
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -4,66 +4,66 @@
 block discarded – undo
4 4
 
5 5
 class ReportRepository extends AbstractRepository
6 6
 {
7
-    /**
8
-     * Return the model full namespace.
9
-     *
10
-     * @return string
11
-     */
12
-    protected function getModel()
13
-    {
14
-        return 'App\Modules\Reporting\Report';
15
-    }
7
+	/**
8
+	 * Return the model full namespace.
9
+	 *
10
+	 * @return string
11
+	 */
12
+	protected function getModel()
13
+	{
14
+		return 'App\Modules\Reporting\Report';
15
+	}
16 16
 
17
-    /**
18
-     * Render the given report db view based on the given
19
-     * condition.
20
-     *
21
-     * @param  string  $reportName
22
-     * @param  array   $conditions
23
-     * @param  integer $perPage
24
-     * @param  array   $relations
25
-     * @param  boolean $skipPermission
26
-     * @return object
27
-     */
28
-    public function getReport($reportName, $conditions = [], $perPage = 0, $relations = [], $skipPermission = false)
29
-    {
30
-        /**
31
-         * Fetch the report from db.
32
-         */
33
-        $reportConditions = $this->constructConditions(['report_name' => $reportName], $this->model);
34
-        $report           = call_user_func_array(
35
-            "{$this->getModel()}::with",
36
-            array($relations)
37
-        )->whereRaw(
38
-            $reportConditions['conditionString'],
39
-            $reportConditions['conditionValues']
40
-        )->first();
17
+	/**
18
+	 * Render the given report db view based on the given
19
+	 * condition.
20
+	 *
21
+	 * @param  string  $reportName
22
+	 * @param  array   $conditions
23
+	 * @param  integer $perPage
24
+	 * @param  array   $relations
25
+	 * @param  boolean $skipPermission
26
+	 * @return object
27
+	 */
28
+	public function getReport($reportName, $conditions = [], $perPage = 0, $relations = [], $skipPermission = false)
29
+	{
30
+		/**
31
+		 * Fetch the report from db.
32
+		 */
33
+		$reportConditions = $this->constructConditions(['report_name' => $reportName], $this->model);
34
+		$report           = call_user_func_array(
35
+			"{$this->getModel()}::with",
36
+			array($relations)
37
+		)->whereRaw(
38
+			$reportConditions['conditionString'],
39
+			$reportConditions['conditionValues']
40
+		)->first();
41 41
         
42
-        /**
43
-         * Check report existance and permission.
44
-         */
45
-        if (! $report) {
46
-            \ErrorHandler::notFound('report');
47
-        } elseif (! $skipPermission && ! \Core::users()->can($report->view_name, 'reports')) {
48
-            \ErrorHandler::noPermissions();
49
-        }
42
+		/**
43
+		 * Check report existance and permission.
44
+		 */
45
+		if (! $report) {
46
+			\ErrorHandler::notFound('report');
47
+		} elseif (! $skipPermission && ! \Core::users()->can($report->view_name, 'reports')) {
48
+			\ErrorHandler::noPermissions();
49
+		}
50 50
 
51
-        /**
52
-         * Fetch data from the report based on the given conditions.
53
-         */
54
-        $report = \DB::table($report->view_name);
55
-        unset($conditions['page']);
56
-        if (count($conditions)) {
57
-            $conditions = $this->constructConditions($conditions, $this->model);
58
-            $report->whereRaw($conditions['conditionString'], $conditions['conditionValues']);
59
-        }
60
-        /**
61
-         * Paginate or all data.
62
-         */
63
-        if ($perPage) {
64
-            return $report->paginate($perPage);
65
-        } else {
66
-            return $report->get();
67
-        }
68
-    }
51
+		/**
52
+		 * Fetch data from the report based on the given conditions.
53
+		 */
54
+		$report = \DB::table($report->view_name);
55
+		unset($conditions['page']);
56
+		if (count($conditions)) {
57
+			$conditions = $this->constructConditions($conditions, $this->model);
58
+			$report->whereRaw($conditions['conditionString'], $conditions['conditionValues']);
59
+		}
60
+		/**
61
+		 * Paginate or all data.
62
+		 */
63
+		if ($perPage) {
64
+			return $report->paginate($perPage);
65
+		} else {
66
+			return $report->get();
67
+		}
68
+	}
69 69
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,9 +42,9 @@
 block discarded – undo
42 42
         /**
43 43
          * Check report existance and permission.
44 44
          */
45
-        if (! $report) {
45
+        if ( ! $report) {
46 46
             \ErrorHandler::notFound('report');
47
-        } elseif (! $skipPermission && ! \Core::users()->can($report->view_name, 'reports')) {
47
+        } elseif ( ! $skipPermission && ! \Core::users()->can($report->view_name, 'reports')) {
48 48
             \ErrorHandler::noPermissions();
49 49
         }
50 50
 
Please login to merge, or discard this patch.
src/Modules/Acl/Database/Factories/GroupFactory.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 $factory->define(App\Modules\Acl\AclGroup::class, function (Faker\Generator $faker) {
4
-    return [
5
-        'name'       => $faker->unique->word(),
6
-        'created_at' => $faker->dateTimeBetween('-1 years', 'now'),
7
-        'updated_at' => $faker->dateTimeBetween('-1 years', 'now')
8
-    ];
4
+	return [
5
+		'name'       => $faker->unique->word(),
6
+		'created_at' => $faker->dateTimeBetween('-1 years', 'now'),
7
+		'updated_at' => $faker->dateTimeBetween('-1 years', 'now')
8
+	];
9 9
 });
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$factory->define(App\Modules\Acl\AclGroup::class, function (Faker\Generator $faker) {
3
+$factory->define(App\Modules\Acl\AclGroup::class, function(Faker\Generator $faker) {
4 4
     return [
5 5
         'name'       => $faker->unique->word(),
6 6
         'created_at' => $faker->dateTimeBetween('-1 years', 'now'),
Please login to merge, or discard this patch.
src/Modules/Acl/Database/Factories/PermissionFactory.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 $factory->define(App\Modules\Acl\AclPermission::class, function (Faker\Generator $faker) {
4
-    return [
5
-        'name'       => $faker->randomElement(['save', 'delete', 'find', 'paginate']),
6
-        'model'      => $faker->randomElement(['users', 'groups', 'settings', 'notifications']),
7
-        'created_at' => $faker->dateTimeBetween('-1 years', 'now'),
8
-        'updated_at' => $faker->dateTimeBetween('-1 years', 'now')
9
-    ];
4
+	return [
5
+		'name'       => $faker->randomElement(['save', 'delete', 'find', 'paginate']),
6
+		'model'      => $faker->randomElement(['users', 'groups', 'settings', 'notifications']),
7
+		'created_at' => $faker->dateTimeBetween('-1 years', 'now'),
8
+		'updated_at' => $faker->dateTimeBetween('-1 years', 'now')
9
+	];
10 10
 });
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$factory->define(App\Modules\Acl\AclPermission::class, function (Faker\Generator $faker) {
3
+$factory->define(App\Modules\Acl\AclPermission::class, function(Faker\Generator $faker) {
4 4
     return [
5 5
         'name'       => $faker->randomElement(['save', 'delete', 'find', 'paginate']),
6 6
         'model'      => $faker->randomElement(['users', 'groups', 'settings', 'notifications']),
Please login to merge, or discard this patch.
src/Modules/Acl/Database/Factories/OauthClientFactory.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 $factory->define(App\Modules\Acl\OauthClient::class, function (Faker\Generator $faker) {
4
-    return [
5
-        'user_id'                => $faker->randomDigit(),
6
-        'name'                   => $faker->name(),
7
-        'secret'                 => \Illuminate\Support\Str::random(40),
8
-        'redirect'               => $faker->url(),
9
-        'personal_access_client' => 0,
10
-        'password_client'        => 0,
11
-        'revoked'                => $faker->boolean(),
12
-        'created_at'             => $faker->dateTimeBetween('-1 years', 'now'),
13
-        'updated_at'             => $faker->dateTimeBetween('-1 years', 'now')
14
-    ];
4
+	return [
5
+		'user_id'                => $faker->randomDigit(),
6
+		'name'                   => $faker->name(),
7
+		'secret'                 => \Illuminate\Support\Str::random(40),
8
+		'redirect'               => $faker->url(),
9
+		'personal_access_client' => 0,
10
+		'password_client'        => 0,
11
+		'revoked'                => $faker->boolean(),
12
+		'created_at'             => $faker->dateTimeBetween('-1 years', 'now'),
13
+		'updated_at'             => $faker->dateTimeBetween('-1 years', 'now')
14
+	];
15 15
 });
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$factory->define(App\Modules\Acl\OauthClient::class, function (Faker\Generator $faker) {
3
+$factory->define(App\Modules\Acl\OauthClient::class, function(Faker\Generator $faker) {
4 4
     return [
5 5
         'user_id'                => $faker->randomDigit(),
6 6
         'name'                   => $faker->name(),
Please login to merge, or discard this patch.
src/Modules/Acl/Database/Factories/UserFactory.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 $factory->define(App\Modules\Acl\AclUser::class, function (Faker\Generator $faker) {
4
-    return [
5
-        'profile_picture' => 'http://lorempixel.com/400/200/',
6
-        'name'            => $faker->name(),
7
-        'email'           => $faker->safeEmail(),
8
-        'password'        => 123456,
9
-        'created_at'      => $faker->dateTimeBetween('-1 years', 'now'),
10
-        'updated_at'      => $faker->dateTimeBetween('-1 years', 'now')
11
-    ];
4
+	return [
5
+		'profile_picture' => 'http://lorempixel.com/400/200/',
6
+		'name'            => $faker->name(),
7
+		'email'           => $faker->safeEmail(),
8
+		'password'        => 123456,
9
+		'created_at'      => $faker->dateTimeBetween('-1 years', 'now'),
10
+		'updated_at'      => $faker->dateTimeBetween('-1 years', 'now')
11
+	];
12 12
 });
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$factory->define(App\Modules\Acl\AclUser::class, function (Faker\Generator $faker) {
3
+$factory->define(App\Modules\Acl\AclUser::class, function(Faker\Generator $faker) {
4 4
     return [
5 5
         'profile_picture' => 'http://lorempixel.com/400/200/',
6 6
         'name'            => $faker->name(),
Please login to merge, or discard this patch.
src/Modules/Acl/Database/Migrations/2015_12_22_145819_groups.php 2 patches
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -5,66 +5,66 @@
 block discarded – undo
5 5
 
6 6
 class Groups extends Migration
7 7
 {
8
-    /**
9
-     * Run the migrations.
10
-     *
11
-     * @return void
12
-     */
13
-    public function up()
14
-    {
15
-        Schema::create('groups', 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('groups', 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_groups', function (Blueprint $table) {
23
-            $table->increments('id');
24
-            $table->integer('user_id');
25
-            $table->integer('group_id');
26
-            $table->softDeletes();
27
-            $table->timestamps();
22
+		Schema::create('users_groups', function (Blueprint $table) {
23
+			$table->increments('id');
24
+			$table->integer('user_id');
25
+			$table->integer('group_id');
26
+			$table->softDeletes();
27
+			$table->timestamps();
28 28
 
29
-            $table->index(['user_id']);
30
-        });
29
+			$table->index(['user_id']);
30
+		});
31 31
         
32
-        /**
33
-         * Create Default groups.
34
-         */
35
-        \DB::table('groups')->insert(
36
-            [
37
-                [
38
-                    'name'       => 'Admin',
39
-                    'created_at' => \DB::raw('NOW()'),
40
-                    'updated_at' => \DB::raw('NOW()')
41
-                ]
42
-            ]
43
-        );
32
+		/**
33
+		 * Create Default groups.
34
+		 */
35
+		\DB::table('groups')->insert(
36
+			[
37
+				[
38
+					'name'       => 'Admin',
39
+					'created_at' => \DB::raw('NOW()'),
40
+					'updated_at' => \DB::raw('NOW()')
41
+				]
42
+			]
43
+		);
44 44
         
45
-        /**
46
-         * Assign default users to admin groups.
47
-         */
48
-        $adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id;
49
-        $adminUserId  = \DB::table('users')->where('email', '[email protected]')->select('id')->first()->id;
50
-        \DB::table('users_groups')->insert(
51
-            [
52
-            'user_id'    => $adminUserId,
53
-            'group_id'   => $adminGroupId,
54
-            'created_at' => \DB::raw('NOW()'),
55
-            'updated_at' => \DB::raw('NOW()')
56
-            ]
57
-        );
58
-    }
45
+		/**
46
+		 * Assign default users to admin groups.
47
+		 */
48
+		$adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id;
49
+		$adminUserId  = \DB::table('users')->where('email', '[email protected]')->select('id')->first()->id;
50
+		\DB::table('users_groups')->insert(
51
+			[
52
+			'user_id'    => $adminUserId,
53
+			'group_id'   => $adminGroupId,
54
+			'created_at' => \DB::raw('NOW()'),
55
+			'updated_at' => \DB::raw('NOW()')
56
+			]
57
+		);
58
+	}
59 59
 
60
-    /**
61
-     * Reverse the migrations.
62
-     *
63
-     * @return void
64
-     */
65
-    public function down()
66
-    {
67
-        Schema::dropIfExists('groups');
68
-        Schema::dropIfExists('users_groups');
69
-    }
60
+	/**
61
+	 * Reverse the migrations.
62
+	 *
63
+	 * @return void
64
+	 */
65
+	public function down()
66
+	{
67
+		Schema::dropIfExists('groups');
68
+		Schema::dropIfExists('users_groups');
69
+	}
70 70
 }
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('groups', function (Blueprint $table) {
15
+        Schema::create('groups', 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_groups', function (Blueprint $table) {
22
+        Schema::create('users_groups', function(Blueprint $table) {
23 23
             $table->increments('id');
24 24
             $table->integer('user_id');
25 25
             $table->integer('group_id');
Please login to merge, or discard this patch.
src/Modules/Acl/Database/Migrations/2016_01_05_130506_permissions.php 2 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -5,40 +5,40 @@
 block discarded – undo
5 5
 
6 6
 class Permissions extends Migration
7 7
 {
8
-    /**
9
-     * Run the migrations.
10
-     *
11
-     * @return void
12
-     */
13
-    public function up()
14
-    {
15
-        Schema::create('permissions', function (Blueprint $table) {
16
-            $table->increments('id');
17
-            $table->string('name', 100);
18
-            $table->string('model', 100);
19
-            $table->softDeletes();
20
-            $table->timestamps();
21
-            $table->unique(array('name', 'model'));
22
-        });
23
-        Schema::create('groups_permissions', function (Blueprint $table) {
24
-            $table->increments('id');
25
-            $table->integer('group_id');
26
-            $table->integer('permission_id');
27
-            $table->softDeletes();
28
-            $table->timestamps();
8
+	/**
9
+	 * Run the migrations.
10
+	 *
11
+	 * @return void
12
+	 */
13
+	public function up()
14
+	{
15
+		Schema::create('permissions', function (Blueprint $table) {
16
+			$table->increments('id');
17
+			$table->string('name', 100);
18
+			$table->string('model', 100);
19
+			$table->softDeletes();
20
+			$table->timestamps();
21
+			$table->unique(array('name', 'model'));
22
+		});
23
+		Schema::create('groups_permissions', function (Blueprint $table) {
24
+			$table->increments('id');
25
+			$table->integer('group_id');
26
+			$table->integer('permission_id');
27
+			$table->softDeletes();
28
+			$table->timestamps();
29 29
 
30
-            $table->index(['group_id']);
31
-        });
32
-    }
30
+			$table->index(['group_id']);
31
+		});
32
+	}
33 33
 
34
-    /**
35
-     * Reverse the migrations.
36
-     *
37
-     * @return void
38
-     */
39
-    public function down()
40
-    {
41
-        Schema::dropIfExists('permissions');
42
-        Schema::dropIfExists('groups_permissions');
43
-    }
34
+	/**
35
+	 * Reverse the migrations.
36
+	 *
37
+	 * @return void
38
+	 */
39
+	public function down()
40
+	{
41
+		Schema::dropIfExists('permissions');
42
+		Schema::dropIfExists('groups_permissions');
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,7 +12,7 @@  discard block
 block discarded – undo
12 12
      */
13 13
     public function up()
14 14
     {
15
-        Schema::create('permissions', function (Blueprint $table) {
15
+        Schema::create('permissions', function(Blueprint $table) {
16 16
             $table->increments('id');
17 17
             $table->string('name', 100);
18 18
             $table->string('model', 100);
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
             $table->timestamps();
21 21
             $table->unique(array('name', 'model'));
22 22
         });
23
-        Schema::create('groups_permissions', function (Blueprint $table) {
23
+        Schema::create('groups_permissions', function(Blueprint $table) {
24 24
             $table->increments('id');
25 25
             $table->integer('group_id');
26 26
             $table->integer('permission_id');
Please login to merge, or discard this patch.
src/Modules/Acl/Database/Migrations/2015_12_20_124153_users.php 2 patches
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -5,51 +5,51 @@
 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
-        });
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 30
 
31
-        /**
32
-         * Create Default users.
33
-         */
34
-        \DB::table('users')->insertGetId(
35
-            [
36
-            'name'       => 'Admin',
37
-            'email'      => '[email protected]',
38
-            'password'   => bcrypt('123456'),
39
-            'confirmed'  => 1,
40
-            'created_at' => \DB::raw('NOW()'),
41
-            'updated_at' => \DB::raw('NOW()')
42
-            ]
43
-        );
44
-    }
31
+		/**
32
+		 * Create Default users.
33
+		 */
34
+		\DB::table('users')->insertGetId(
35
+			[
36
+			'name'       => 'Admin',
37
+			'email'      => '[email protected]',
38
+			'password'   => bcrypt('123456'),
39
+			'confirmed'  => 1,
40
+			'created_at' => \DB::raw('NOW()'),
41
+			'updated_at' => \DB::raw('NOW()')
42
+			]
43
+		);
44
+	}
45 45
 
46
-    /**
47
-     * Reverse the migrations.
48
-     *
49
-     * @return void
50
-     */
51
-    public function down()
52
-    {
53
-        Schema::dropIfExists('users');
54
-    }
46
+	/**
47
+	 * Reverse the migrations.
48
+	 *
49
+	 * @return void
50
+	 */
51
+	public function down()
52
+	{
53
+		Schema::dropIfExists('users');
54
+	}
55 55
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
      */
13 13
     public function up()
14 14
     {
15
-        Schema::create('users', function (Blueprint $table) {
15
+        Schema::create('users', function(Blueprint $table) {
16 16
             $table->increments('id');
17 17
             $table->string('profile_picture', 150)->nullable();
18 18
             $table->string('name', 100)->nullable();
Please login to merge, or discard this patch.
src/Modules/Acl/Database/Seeds/UsersTableSeeder.php 1 patch
Indentation   +108 added lines, -108 removed lines patch added patch discarded remove patch
@@ -6,112 +6,112 @@
 block discarded – undo
6 6
 
7 7
 class UsersTableSeeder extends Seeder
8 8
 {
9
-    /**
10
-     * Run the database seeds.
11
-     *
12
-     * @return void
13
-     */
14
-    public function run()
15
-    {
16
-        /**
17
-         * Insert the permissions related to users table.
18
-         */
19
-        \DB::table('permissions')->insert(
20
-            [
21
-                /**
22
-                 * Users model permissions.
23
-                 */
24
-                [
25
-                'name'       => 'save',
26
-                'model'      => 'users',
27
-                'created_at' => \DB::raw('NOW()'),
28
-                'updated_at' => \DB::raw('NOW()')
29
-                ],
30
-                [
31
-                'name'       => 'delete',
32
-                'model'      => 'users',
33
-                'created_at' => \DB::raw('NOW()'),
34
-                'updated_at' => \DB::raw('NOW()')
35
-                ],
36
-                [
37
-                'name'       => 'find',
38
-                'model'      => 'users',
39
-                'created_at' => \DB::raw('NOW()'),
40
-                'updated_at' => \DB::raw('NOW()')
41
-                ],
42
-                [
43
-                'name'       => 'list',
44
-                'model'      => 'users',
45
-                'created_at' => \DB::raw('NOW()'),
46
-                'updated_at' => \DB::raw('NOW()')
47
-                ],
48
-                [
49
-                'name'       => 'search',
50
-                'model'      => 'users',
51
-                'created_at' => \DB::raw('NOW()'),
52
-                'updated_at' => \DB::raw('NOW()')
53
-                ],
54
-                [
55
-                'name'       => 'findby',
56
-                'model'      => 'users',
57
-                'created_at' => \DB::raw('NOW()'),
58
-                'updated_at' => \DB::raw('NOW()')
59
-                ],
60
-                [
61
-                'name'       => 'first',
62
-                'model'      => 'users',
63
-                'created_at' => \DB::raw('NOW()'),
64
-                'updated_at' => \DB::raw('NOW()')
65
-                ],
66
-                [
67
-                'name'       => 'paginate',
68
-                'model'      => 'users',
69
-                'created_at' => \DB::raw('NOW()'),
70
-                'updated_at' => \DB::raw('NOW()')
71
-                ],
72
-                [
73
-                'name'       => 'paginateby',
74
-                'model'      => 'users',
75
-                'created_at' => \DB::raw('NOW()'),
76
-                'updated_at' => \DB::raw('NOW()')
77
-                ],
78
-                [
79
-                'name'       => 'assigngroups',
80
-                'model'      => 'users',
81
-                'created_at' => \DB::raw('NOW()'),
82
-                'updated_at' => \DB::raw('NOW()')
83
-                ],
84
-                [
85
-                'name'       => 'block',
86
-                'model'      => 'users',
87
-                'created_at' => \DB::raw('NOW()'),
88
-                'updated_at' => \DB::raw('NOW()')
89
-                ],
90
-                [
91
-                'name'       => 'unblock',
92
-                'model'      => 'users',
93
-                'created_at' => \DB::raw('NOW()'),
94
-                'updated_at' => \DB::raw('NOW()')
95
-                ],
96
-                [
97
-                'name'       => 'group',
98
-                'model'      => 'users',
99
-                'created_at' => \DB::raw('NOW()'),
100
-                'updated_at' => \DB::raw('NOW()')
101
-                ],
102
-                [
103
-                'name'       => 'deleted',
104
-                'model'      => 'users',
105
-                'created_at' => \DB::raw('NOW()'),
106
-                'updated_at' => \DB::raw('NOW()')
107
-                ],
108
-                [
109
-                'name'       => 'restore',
110
-                'model'      => 'users',
111
-                'created_at' => \DB::raw('NOW()'),
112
-                'updated_at' => \DB::raw('NOW()')
113
-                ]
114
-            ]
115
-        );
116
-    }
9
+	/**
10
+	 * Run the database seeds.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function run()
15
+	{
16
+		/**
17
+		 * Insert the permissions related to users table.
18
+		 */
19
+		\DB::table('permissions')->insert(
20
+			[
21
+				/**
22
+				 * Users model permissions.
23
+				 */
24
+				[
25
+				'name'       => 'save',
26
+				'model'      => 'users',
27
+				'created_at' => \DB::raw('NOW()'),
28
+				'updated_at' => \DB::raw('NOW()')
29
+				],
30
+				[
31
+				'name'       => 'delete',
32
+				'model'      => 'users',
33
+				'created_at' => \DB::raw('NOW()'),
34
+				'updated_at' => \DB::raw('NOW()')
35
+				],
36
+				[
37
+				'name'       => 'find',
38
+				'model'      => 'users',
39
+				'created_at' => \DB::raw('NOW()'),
40
+				'updated_at' => \DB::raw('NOW()')
41
+				],
42
+				[
43
+				'name'       => 'list',
44
+				'model'      => 'users',
45
+				'created_at' => \DB::raw('NOW()'),
46
+				'updated_at' => \DB::raw('NOW()')
47
+				],
48
+				[
49
+				'name'       => 'search',
50
+				'model'      => 'users',
51
+				'created_at' => \DB::raw('NOW()'),
52
+				'updated_at' => \DB::raw('NOW()')
53
+				],
54
+				[
55
+				'name'       => 'findby',
56
+				'model'      => 'users',
57
+				'created_at' => \DB::raw('NOW()'),
58
+				'updated_at' => \DB::raw('NOW()')
59
+				],
60
+				[
61
+				'name'       => 'first',
62
+				'model'      => 'users',
63
+				'created_at' => \DB::raw('NOW()'),
64
+				'updated_at' => \DB::raw('NOW()')
65
+				],
66
+				[
67
+				'name'       => 'paginate',
68
+				'model'      => 'users',
69
+				'created_at' => \DB::raw('NOW()'),
70
+				'updated_at' => \DB::raw('NOW()')
71
+				],
72
+				[
73
+				'name'       => 'paginateby',
74
+				'model'      => 'users',
75
+				'created_at' => \DB::raw('NOW()'),
76
+				'updated_at' => \DB::raw('NOW()')
77
+				],
78
+				[
79
+				'name'       => 'assigngroups',
80
+				'model'      => 'users',
81
+				'created_at' => \DB::raw('NOW()'),
82
+				'updated_at' => \DB::raw('NOW()')
83
+				],
84
+				[
85
+				'name'       => 'block',
86
+				'model'      => 'users',
87
+				'created_at' => \DB::raw('NOW()'),
88
+				'updated_at' => \DB::raw('NOW()')
89
+				],
90
+				[
91
+				'name'       => 'unblock',
92
+				'model'      => 'users',
93
+				'created_at' => \DB::raw('NOW()'),
94
+				'updated_at' => \DB::raw('NOW()')
95
+				],
96
+				[
97
+				'name'       => 'group',
98
+				'model'      => 'users',
99
+				'created_at' => \DB::raw('NOW()'),
100
+				'updated_at' => \DB::raw('NOW()')
101
+				],
102
+				[
103
+				'name'       => 'deleted',
104
+				'model'      => 'users',
105
+				'created_at' => \DB::raw('NOW()'),
106
+				'updated_at' => \DB::raw('NOW()')
107
+				],
108
+				[
109
+				'name'       => 'restore',
110
+				'model'      => 'users',
111
+				'created_at' => \DB::raw('NOW()'),
112
+				'updated_at' => \DB::raw('NOW()')
113
+				]
114
+			]
115
+		);
116
+	}
117 117
 }
Please login to merge, or discard this patch.