Completed
Push — master ( b7f417...e961f1 )
by Sherif
02:36
created
src/Modules/V1/Acl/ModelObservers/OauthClientObserver.php 1 patch
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -5,53 +5,53 @@
 block discarded – undo
5 5
  */
6 6
 class OauthClientObserver {
7 7
 
8
-    public function saving($model)
9
-    {
10
-        //
11
-    }
12
-
13
-    public function saved($model)
14
-    {
15
-        //
16
-    }
17
-
18
-    public function creating($model)
19
-    {
20
-        $model->secret = str_random(40);
21
-    }
22
-
23
-    public function created($model)
24
-    {
25
-        //
26
-    }
27
-
28
-    public function updating($model)
29
-    {
30
-        //
31
-    }
32
-
33
-    public function updated($model)
34
-    {
35
-        //
36
-    }
37
-
38
-    public function deleting($model)
39
-    {
40
-        //
41
-    }
42
-
43
-    public function deleted($model)
44
-    {
45
-        //
46
-    }
47
-
48
-    public function restoring($model)
49
-    {
50
-        //
51
-    }
52
-
53
-    public function restored($model)
54
-    {
55
-        //
56
-    }
8
+	public function saving($model)
9
+	{
10
+		//
11
+	}
12
+
13
+	public function saved($model)
14
+	{
15
+		//
16
+	}
17
+
18
+	public function creating($model)
19
+	{
20
+		$model->secret = str_random(40);
21
+	}
22
+
23
+	public function created($model)
24
+	{
25
+		//
26
+	}
27
+
28
+	public function updating($model)
29
+	{
30
+		//
31
+	}
32
+
33
+	public function updated($model)
34
+	{
35
+		//
36
+	}
37
+
38
+	public function deleting($model)
39
+	{
40
+		//
41
+	}
42
+
43
+	public function deleted($model)
44
+	{
45
+		//
46
+	}
47
+
48
+	public function restoring($model)
49
+	{
50
+		//
51
+	}
52
+
53
+	public function restored($model)
54
+	{
55
+		//
56
+	}
57 57
 }
58 58
\ No newline at end of file
Please login to merge, or discard this patch.
src/Modules/V1/Acl/Database/Seeds/AclDatabaseSeeder.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -6,18 +6,18 @@
 block discarded – undo
6 6
 
7 7
 class AclDatabaseSeeder extends Seeder
8 8
 {
9
-    /**
10
-     * Run the database seeds.
11
-     *
12
-     * @return void
13
-     */
14
-    public function run()
15
-    {
16
-        $this->call(ClearDataSeeder::class);
17
-    	$this->call(UsersTableSeeder::class);
18
-    	$this->call(GroupsTableSeeder::class);
19
-    	$this->call(PermissionsTableSeeder::class);
20
-        $this->call(OauthClientsTableSeeder::class);
21
-    	$this->call(AssignRelationsSeeder::class);
22
-    }
9
+	/**
10
+	 * Run the database seeds.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function run()
15
+	{
16
+		$this->call(ClearDataSeeder::class);
17
+		$this->call(UsersTableSeeder::class);
18
+		$this->call(GroupsTableSeeder::class);
19
+		$this->call(PermissionsTableSeeder::class);
20
+		$this->call(OauthClientsTableSeeder::class);
21
+		$this->call(AssignRelationsSeeder::class);
22
+	}
23 23
 }
Please login to merge, or discard this patch.
src/Modules/V1/Acl/Database/Factories/OauthClientFactory.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 $factory->define(App\Modules\V1\Acl\OauthClient::class, function (Faker\Generator $faker) {
4
-    return [
5
-    	'user_id'                => $faker->randomDigit(),
4
+	return [
5
+		'user_id'                => $faker->randomDigit(),
6 6
 		'name'                   => $faker->name(),
7 7
 		'secret'                 => str_random(40),
8 8
 		'redirect'               => $faker->url(),
@@ -11,5 +11,5 @@  discard block
 block discarded – undo
11 11
 		'revoked'                => $faker->boolean(),
12 12
 		'created_at'             => $faker->dateTimeBetween('-1 years', 'now'),
13 13
 		'updated_at'             => $faker->dateTimeBetween('-1 years', 'now')
14
-    ];
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\V1\Acl\OauthClient::class, function (Faker\Generator $faker) {
3
+$factory->define(App\Modules\V1\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.
Database/Migrations/2016_06_01_000002_create_oauth_access_tokens_table.php 2 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -6,32 +6,32 @@
 block discarded – undo
6 6
 
7 7
 class CreateOauthAccessTokensTable extends Migration
8 8
 {
9
-    /**
10
-     * Run the migrations.
11
-     *
12
-     * @return void
13
-     */
14
-    public function up()
15
-    {
16
-        Schema::create('oauth_access_tokens', function (Blueprint $table) {
17
-            $table->string('id', 100)->primary();
18
-            $table->integer('user_id')->index()->nullable();
19
-            $table->integer('client_id');
20
-            $table->string('name')->nullable();
21
-            $table->text('scopes')->nullable();
22
-            $table->boolean('revoked');
23
-            $table->timestamps();
24
-            $table->dateTime('expires_at')->nullable();
25
-        });
26
-    }
9
+	/**
10
+	 * Run the migrations.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function up()
15
+	{
16
+		Schema::create('oauth_access_tokens', function (Blueprint $table) {
17
+			$table->string('id', 100)->primary();
18
+			$table->integer('user_id')->index()->nullable();
19
+			$table->integer('client_id');
20
+			$table->string('name')->nullable();
21
+			$table->text('scopes')->nullable();
22
+			$table->boolean('revoked');
23
+			$table->timestamps();
24
+			$table->dateTime('expires_at')->nullable();
25
+		});
26
+	}
27 27
 
28
-    /**
29
-     * Reverse the migrations.
30
-     *
31
-     * @return void
32
-     */
33
-    public function down()
34
-    {
35
-        Schema::drop('oauth_access_tokens');
36
-    }
28
+	/**
29
+	 * Reverse the migrations.
30
+	 *
31
+	 * @return void
32
+	 */
33
+	public function down()
34
+	{
35
+		Schema::drop('oauth_access_tokens');
36
+	}
37 37
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('oauth_access_tokens', function (Blueprint $table) {
16
+        Schema::create('oauth_access_tokens', function(Blueprint $table) {
17 17
             $table->string('id', 100)->primary();
18 18
             $table->integer('user_id')->index()->nullable();
19 19
             $table->integer('client_id');
Please login to merge, or discard this patch.
Migrations/2016_06_01_000005_create_oauth_personal_access_clients_table.php 2 patches
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 CreateOauthPersonalAccessClientsTable extends Migration
8 8
 {
9
-    /**
10
-     * Run the migrations.
11
-     *
12
-     * @return void
13
-     */
14
-    public function up()
15
-    {
16
-        Schema::create('oauth_personal_access_clients', function (Blueprint $table) {
17
-            $table->increments('id');
18
-            $table->integer('client_id')->index();
19
-            $table->timestamps();
20
-        });
21
-    }
9
+	/**
10
+	 * Run the migrations.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function up()
15
+	{
16
+		Schema::create('oauth_personal_access_clients', function (Blueprint $table) {
17
+			$table->increments('id');
18
+			$table->integer('client_id')->index();
19
+			$table->timestamps();
20
+		});
21
+	}
22 22
 
23
-    /**
24
-     * Reverse the migrations.
25
-     *
26
-     * @return void
27
-     */
28
-    public function down()
29
-    {
30
-        Schema::drop('oauth_personal_access_clients');
31
-    }
23
+	/**
24
+	 * Reverse the migrations.
25
+	 *
26
+	 * @return void
27
+	 */
28
+	public function down()
29
+	{
30
+		Schema::drop('oauth_personal_access_clients');
31
+	}
32 32
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('oauth_personal_access_clients', function (Blueprint $table) {
16
+        Schema::create('oauth_personal_access_clients', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->integer('client_id')->index();
19 19
             $table->timestamps();
Please login to merge, or discard this patch.
Database/Migrations/2016_06_01_000003_create_oauth_refresh_tokens_table.php 2 patches
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -6,28 +6,28 @@
 block discarded – undo
6 6
 
7 7
 class CreateOauthRefreshTokensTable extends Migration
8 8
 {
9
-    /**
10
-     * Run the migrations.
11
-     *
12
-     * @return void
13
-     */
14
-    public function up()
15
-    {
16
-        Schema::create('oauth_refresh_tokens', function (Blueprint $table) {
17
-            $table->string('id', 100)->primary();
18
-            $table->string('access_token_id', 100)->index();
19
-            $table->boolean('revoked');
20
-            $table->dateTime('expires_at')->nullable();
21
-        });
22
-    }
9
+	/**
10
+	 * Run the migrations.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function up()
15
+	{
16
+		Schema::create('oauth_refresh_tokens', function (Blueprint $table) {
17
+			$table->string('id', 100)->primary();
18
+			$table->string('access_token_id', 100)->index();
19
+			$table->boolean('revoked');
20
+			$table->dateTime('expires_at')->nullable();
21
+		});
22
+	}
23 23
 
24
-    /**
25
-     * Reverse the migrations.
26
-     *
27
-     * @return void
28
-     */
29
-    public function down()
30
-    {
31
-        Schema::drop('oauth_refresh_tokens');
32
-    }
24
+	/**
25
+	 * Reverse the migrations.
26
+	 *
27
+	 * @return void
28
+	 */
29
+	public function down()
30
+	{
31
+		Schema::drop('oauth_refresh_tokens');
32
+	}
33 33
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('oauth_refresh_tokens', function (Blueprint $table) {
16
+        Schema::create('oauth_refresh_tokens', function(Blueprint $table) {
17 17
             $table->string('id', 100)->primary();
18 18
             $table->string('access_token_id', 100)->index();
19 19
             $table->boolean('revoked');
Please login to merge, or discard this patch.
V1/Acl/Database/Migrations/2016_06_01_000004_create_oauth_clients_table.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('oauth_clients', function (Blueprint $table) {
16
+        Schema::create('oauth_clients', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->integer('user_id')->index()->nullable();
19 19
             $table->string('name');
Please login to merge, or discard this patch.
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -6,33 +6,33 @@
 block discarded – undo
6 6
 
7 7
 class CreateOauthClientsTable extends Migration
8 8
 {
9
-    /**
10
-     * Run the migrations.
11
-     *
12
-     * @return void
13
-     */
14
-    public function up()
15
-    {
16
-        Schema::create('oauth_clients', function (Blueprint $table) {
17
-            $table->increments('id');
18
-            $table->integer('user_id')->index()->nullable();
19
-            $table->string('name');
20
-            $table->string('secret', 100);
21
-            $table->text('redirect');
22
-            $table->boolean('personal_access_client')->default(0);
23
-            $table->boolean('password_client')->default(0);
24
-            $table->boolean('revoked')->default(0);
25
-            $table->timestamps();
26
-        });
27
-    }
9
+	/**
10
+	 * Run the migrations.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function up()
15
+	{
16
+		Schema::create('oauth_clients', function (Blueprint $table) {
17
+			$table->increments('id');
18
+			$table->integer('user_id')->index()->nullable();
19
+			$table->string('name');
20
+			$table->string('secret', 100);
21
+			$table->text('redirect');
22
+			$table->boolean('personal_access_client')->default(0);
23
+			$table->boolean('password_client')->default(0);
24
+			$table->boolean('revoked')->default(0);
25
+			$table->timestamps();
26
+		});
27
+	}
28 28
 
29
-    /**
30
-     * Reverse the migrations.
31
-     *
32
-     * @return void
33
-     */
34
-    public function down()
35
-    {
36
-        Schema::drop('oauth_clients');
37
-    }
29
+	/**
30
+	 * Reverse the migrations.
31
+	 *
32
+	 * @return void
33
+	 */
34
+	public function down()
35
+	{
36
+		Schema::drop('oauth_clients');
37
+	}
38 38
 }
Please login to merge, or discard this patch.
Acl/Database/Migrations/2016_06_01_000001_create_oauth_auth_codes_table.php 2 patches
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -6,30 +6,30 @@
 block discarded – undo
6 6
 
7 7
 class CreateOauthAuthCodesTable extends Migration
8 8
 {
9
-    /**
10
-     * Run the migrations.
11
-     *
12
-     * @return void
13
-     */
14
-    public function up()
15
-    {
16
-        Schema::create('oauth_auth_codes', function (Blueprint $table) {
17
-            $table->string('id', 100)->primary();
18
-            $table->integer('user_id');
19
-            $table->integer('client_id');
20
-            $table->text('scopes')->nullable();
21
-            $table->boolean('revoked');
22
-            $table->dateTime('expires_at')->nullable();
23
-        });
24
-    }
9
+	/**
10
+	 * Run the migrations.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function up()
15
+	{
16
+		Schema::create('oauth_auth_codes', function (Blueprint $table) {
17
+			$table->string('id', 100)->primary();
18
+			$table->integer('user_id');
19
+			$table->integer('client_id');
20
+			$table->text('scopes')->nullable();
21
+			$table->boolean('revoked');
22
+			$table->dateTime('expires_at')->nullable();
23
+		});
24
+	}
25 25
 
26
-    /**
27
-     * Reverse the migrations.
28
-     *
29
-     * @return void
30
-     */
31
-    public function down()
32
-    {
33
-        Schema::drop('oauth_auth_codes');
34
-    }
26
+	/**
27
+	 * Reverse the migrations.
28
+	 *
29
+	 * @return void
30
+	 */
31
+	public function down()
32
+	{
33
+		Schema::drop('oauth_auth_codes');
34
+	}
35 35
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('oauth_auth_codes', function (Blueprint $table) {
16
+        Schema::create('oauth_auth_codes', function(Blueprint $table) {
17 17
             $table->string('id', 100)->primary();
18 18
             $table->integer('user_id');
19 19
             $table->integer('client_id');
Please login to merge, or discard this patch.
src/Modules/V1/Core/Utl/ErrorHandler.php 1 patch
Indentation   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -2,105 +2,105 @@
 block discarded – undo
2 2
 
3 3
 class ErrorHandler
4 4
 {
5
-    public function unAuthorized()
6
-    {
7
-        $error = ['status' => 401, 'message' => trans('errors.unAuthorized')];
8
-        abort($error['status'], $error['message']);
9
-    }
10
-
11
-    public function invalidRefreshToken()
12
-    {
13
-        $error = ['status' => 401, 'message' => trans('errors.invalidRefreshToken')];
14
-        abort($error['status'], $error['message']);
15
-    }
16
-
17
-     public function noPermissions()
18
-    {
19
-        $error = ['status' => 403, 'message' => trans('errors.noPermissions')];
20
-        abort($error['status'], $error['message']);
21
-    }
22
-
23
-    public function loginFailed()
24
-    {
25
-        $error = ['status' => 400, 'message' => trans('errors.loginFailed')];
26
-        abort($error['status'], $error['message']);
27
-    }
28
-
29
-    public function noSocialEmail()
30
-    {
31
-        $error = ['status' => 400, 'message' => trans('errors.noSocialEmail')];
32
-        abort($error['status'], $error['message']);
33
-    }
34
-
35
-    public function userAlreadyRegistered()
36
-    {
37
-        $error = ['status' => 400, 'message' => trans('errors.userAlreadyRegistered')];
38
-        abort($error['status'], $error['message']);
39
-    }
40
-
41
-    public function connectionError()
42
-    {
43
-        $error = ['status' => 400, 'message' => trans('errors.connectionError')];
44
-        abort($error['status'], $error['message']);
45
-    }
46
-
47
-    public function redisNotRunning()
48
-    {
49
-        $error = ['status' => 400, 'message' => trans('errors.redisNotRunning')];
50
-        abort($error['status'], $error['message']);
51
-    }
52
-
53
-    public function dbQueryError()
54
-    {
55
-        $error = ['status' => 400, 'message' => trans('errors.dbQueryError')];
56
-        abort($error['status'], $error['message']);
57
-    }
58
-
59
-    public function cannotCreateSetting()
60
-    {
61
-        $error = ['status' => 400, 'message' => trans('errors.cannotCreateSetting')];
62
-        abort($error['status'], $error['message']);
63
-    }
64
-
65
-    public function cannotUpdateSettingKey()
66
-    {
67
-        $error = ['status' => 400, 'message' => trans('errors.cannotUpdateSettingKey')];
68
-        abort($error['status'], $error['message']);
69
-    }
70
-
71
-    public function userIsBlocked()
72
-    {
73
-        $error = ['status' => 403, 'message' => trans('errors.userIsBlocked')];
74
-        abort($error['status'], $error['message']);
75
-    }
76
-
77
-    public function invalidResetToken()
78
-    {
79
-        $error = ['status' => 400, 'message' => trans('errors.invalidResetToken')];
80
-        abort($error['status'], $error['message']);
81
-    }
82
-
83
-    public function invalidResetPassword()
84
-    {
85
-        $error = ['status' => 400, 'message' => trans('errors.invalidResetPassword')];
86
-        abort($error['status'], $error['message']);
87
-    }
88
-
89
-    public function invalidOldPassword()
90
-    {
91
-        $error = ['status' => 400, 'message' => trans('errors.invalidOldPassword')];
92
-        abort($error['status'], $error['message']);
93
-    }
94
-
95
-    public function notFound($text)
96
-    {
97
-        $error = ['status' => 404, 'message' => trans('errors.notFound', ['replace' => $text])];
98
-        abort($error['status'], $error['message']);
99
-    }
100
-
101
-    public function generalError()
102
-    {
103
-        $error = ['status' => 400, 'message' => trans('errors.generalError')];
104
-        abort($error['status'], $error['message']);
105
-    }
5
+	public function unAuthorized()
6
+	{
7
+		$error = ['status' => 401, 'message' => trans('errors.unAuthorized')];
8
+		abort($error['status'], $error['message']);
9
+	}
10
+
11
+	public function invalidRefreshToken()
12
+	{
13
+		$error = ['status' => 401, 'message' => trans('errors.invalidRefreshToken')];
14
+		abort($error['status'], $error['message']);
15
+	}
16
+
17
+	 public function noPermissions()
18
+	{
19
+		$error = ['status' => 403, 'message' => trans('errors.noPermissions')];
20
+		abort($error['status'], $error['message']);
21
+	}
22
+
23
+	public function loginFailed()
24
+	{
25
+		$error = ['status' => 400, 'message' => trans('errors.loginFailed')];
26
+		abort($error['status'], $error['message']);
27
+	}
28
+
29
+	public function noSocialEmail()
30
+	{
31
+		$error = ['status' => 400, 'message' => trans('errors.noSocialEmail')];
32
+		abort($error['status'], $error['message']);
33
+	}
34
+
35
+	public function userAlreadyRegistered()
36
+	{
37
+		$error = ['status' => 400, 'message' => trans('errors.userAlreadyRegistered')];
38
+		abort($error['status'], $error['message']);
39
+	}
40
+
41
+	public function connectionError()
42
+	{
43
+		$error = ['status' => 400, 'message' => trans('errors.connectionError')];
44
+		abort($error['status'], $error['message']);
45
+	}
46
+
47
+	public function redisNotRunning()
48
+	{
49
+		$error = ['status' => 400, 'message' => trans('errors.redisNotRunning')];
50
+		abort($error['status'], $error['message']);
51
+	}
52
+
53
+	public function dbQueryError()
54
+	{
55
+		$error = ['status' => 400, 'message' => trans('errors.dbQueryError')];
56
+		abort($error['status'], $error['message']);
57
+	}
58
+
59
+	public function cannotCreateSetting()
60
+	{
61
+		$error = ['status' => 400, 'message' => trans('errors.cannotCreateSetting')];
62
+		abort($error['status'], $error['message']);
63
+	}
64
+
65
+	public function cannotUpdateSettingKey()
66
+	{
67
+		$error = ['status' => 400, 'message' => trans('errors.cannotUpdateSettingKey')];
68
+		abort($error['status'], $error['message']);
69
+	}
70
+
71
+	public function userIsBlocked()
72
+	{
73
+		$error = ['status' => 403, 'message' => trans('errors.userIsBlocked')];
74
+		abort($error['status'], $error['message']);
75
+	}
76
+
77
+	public function invalidResetToken()
78
+	{
79
+		$error = ['status' => 400, 'message' => trans('errors.invalidResetToken')];
80
+		abort($error['status'], $error['message']);
81
+	}
82
+
83
+	public function invalidResetPassword()
84
+	{
85
+		$error = ['status' => 400, 'message' => trans('errors.invalidResetPassword')];
86
+		abort($error['status'], $error['message']);
87
+	}
88
+
89
+	public function invalidOldPassword()
90
+	{
91
+		$error = ['status' => 400, 'message' => trans('errors.invalidOldPassword')];
92
+		abort($error['status'], $error['message']);
93
+	}
94
+
95
+	public function notFound($text)
96
+	{
97
+		$error = ['status' => 404, 'message' => trans('errors.notFound', ['replace' => $text])];
98
+		abort($error['status'], $error['message']);
99
+	}
100
+
101
+	public function generalError()
102
+	{
103
+		$error = ['status' => 400, 'message' => trans('errors.generalError')];
104
+		abort($error['status'], $error['message']);
105
+	}
106 106
 }
107 107
\ No newline at end of file
Please login to merge, or discard this patch.