Completed
Push — master ( a38508...8df45b )
by Sherif
02:18
created
src/Modules/OauthClients/Providers/RouteServiceProvider.php 2 patches
Indentation   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -7,73 +7,73 @@
 block discarded – undo
7 7
 
8 8
 class RouteServiceProvider extends ServiceProvider
9 9
 {
10
-    /**
11
-     * This namespace is applied to your controller routes.
12
-     *
13
-     * In addition, it is set as the URL generator's root namespace.
14
-     *
15
-     * @var string
16
-     */
17
-    protected $namespace = 'App\Modules\OauthClients\Http\Controllers';
10
+	/**
11
+	 * This namespace is applied to your controller routes.
12
+	 *
13
+	 * In addition, it is set as the URL generator's root namespace.
14
+	 *
15
+	 * @var string
16
+	 */
17
+	protected $namespace = 'App\Modules\OauthClients\Http\Controllers';
18 18
 
19
-    /**
20
-     * Define your route model bindings, pattern filters, etc.
21
-     *
22
-     * @return void
23
-     */
24
-    public function boot()
25
-    {
26
-        //
19
+	/**
20
+	 * Define your route model bindings, pattern filters, etc.
21
+	 *
22
+	 * @return void
23
+	 */
24
+	public function boot()
25
+	{
26
+		//
27 27
 
28
-        parent::boot();
29
-    }
28
+		parent::boot();
29
+	}
30 30
 
31
-    /**
32
-     * Define the routes for the module.
33
-     *
34
-     * @return void
35
-     */
36
-    public function map()
37
-    {
38
-        $this->mapWebRoutes();
31
+	/**
32
+	 * Define the routes for the module.
33
+	 *
34
+	 * @return void
35
+	 */
36
+	public function map()
37
+	{
38
+		$this->mapWebRoutes();
39 39
 
40
-        $this->mapApiRoutes();
40
+		$this->mapApiRoutes();
41 41
 
42
-        //
43
-    }
42
+		//
43
+	}
44 44
 
45
-    /**
46
-     * Define the "web" routes for the module.
47
-     *
48
-     * These routes all receive session state, CSRF protection, etc.
49
-     *
50
-     * @return void
51
-     */
52
-    protected function mapWebRoutes()
53
-    {
54
-        Route::group([
55
-            'middleware' => 'web',
56
-            'namespace'  => $this->namespace,
57
-        ], function ($router) {
58
-            require module_path('oauth-clients', 'Routes/web.php', 'app');
59
-        });
60
-    }
45
+	/**
46
+	 * Define the "web" routes for the module.
47
+	 *
48
+	 * These routes all receive session state, CSRF protection, etc.
49
+	 *
50
+	 * @return void
51
+	 */
52
+	protected function mapWebRoutes()
53
+	{
54
+		Route::group([
55
+			'middleware' => 'web',
56
+			'namespace'  => $this->namespace,
57
+		], function ($router) {
58
+			require module_path('oauth-clients', 'Routes/web.php', 'app');
59
+		});
60
+	}
61 61
 
62
-    /**
63
-     * Define the "api" routes for the module.
64
-     *
65
-     * These routes are typically stateless.
66
-     *
67
-     * @return void
68
-     */
69
-    protected function mapApiRoutes()
70
-    {
71
-        Route::group([
72
-            'middleware' => 'api',
73
-            'namespace'  => $this->namespace,
74
-            'prefix'     => 'api',
75
-        ], function ($router) {
76
-            require module_path('oauth-clients', 'Routes/api.php', 'app');
77
-        });
78
-    }
62
+	/**
63
+	 * Define the "api" routes for the module.
64
+	 *
65
+	 * These routes are typically stateless.
66
+	 *
67
+	 * @return void
68
+	 */
69
+	protected function mapApiRoutes()
70
+	{
71
+		Route::group([
72
+			'middleware' => 'api',
73
+			'namespace'  => $this->namespace,
74
+			'prefix'     => 'api',
75
+		], function ($router) {
76
+			require module_path('oauth-clients', 'Routes/api.php', 'app');
77
+		});
78
+	}
79 79
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         Route::group([
55 55
             'middleware' => 'web',
56 56
             'namespace'  => $this->namespace,
57
-        ], function ($router) {
57
+        ], function($router) {
58 58
             require module_path('oauth-clients', 'Routes/web.php', 'app');
59 59
         });
60 60
     }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             'middleware' => 'api',
73 73
             'namespace'  => $this->namespace,
74 74
             'prefix'     => 'api',
75
-        ], function ($router) {
75
+        ], function($router) {
76 76
             require module_path('oauth-clients', 'Routes/api.php', 'app');
77 77
         });
78 78
     }
Please login to merge, or discard this patch.
src/Modules/OauthClients/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\OauthClients\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\OauthClients\OauthClient::class, function (Faker\Generator $faker) {
3
+$factory->define(App\Modules\OauthClients\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/OauthClients/Database/Seeds/OauthClientsTableSeeder.php 1 patch
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -6,58 +6,58 @@
 block discarded – undo
6 6
 
7 7
 class OauthClientsTableSeeder 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 oauthClients table.
18
-         */
19
-        \DB::table('permissions')->insert(
20
-            [
21
-                /**
22
-                 * OauthClients model permissions.
23
-                 */
24
-                [
25
-                'name'       => 'index',
26
-                'model'      => 'oauthClient',
27
-                'created_at' => \DB::raw('NOW()'),
28
-                'updated_at' => \DB::raw('NOW()')
29
-                ],
30
-                [
31
-                'name'       => 'find',
32
-                'model'      => 'oauthClient',
33
-                'created_at' => \DB::raw('NOW()'),
34
-                'updated_at' => \DB::raw('NOW()')
35
-                ],
36
-                [
37
-                'name'       => 'insert',
38
-                'model'      => 'oauthClient',
39
-                'created_at' => \DB::raw('NOW()'),
40
-                'updated_at' => \DB::raw('NOW()')
41
-                ],
42
-                [
43
-                'name'       => 'update',
44
-                'model'      => 'oauthClient',
45
-                'created_at' => \DB::raw('NOW()'),
46
-                'updated_at' => \DB::raw('NOW()')
47
-                ],
48
-                [
49
-                'name'       => 'revoke',
50
-                'model'      => 'oauthClient',
51
-                'created_at' => \DB::raw('NOW()'),
52
-                'updated_at' => \DB::raw('NOW()')
53
-                ],
54
-                [
55
-                'name'       => 'unRevoke',
56
-                'model'      => 'oauthClient',
57
-                'created_at' => \DB::raw('NOW()'),
58
-                'updated_at' => \DB::raw('NOW()')
59
-                ],
60
-            ]
61
-        );
62
-    }
9
+	/**
10
+	 * Run the database seeds.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function run()
15
+	{
16
+		/**
17
+		 * Insert the permissions related to oauthClients table.
18
+		 */
19
+		\DB::table('permissions')->insert(
20
+			[
21
+				/**
22
+				 * OauthClients model permissions.
23
+				 */
24
+				[
25
+				'name'       => 'index',
26
+				'model'      => 'oauthClient',
27
+				'created_at' => \DB::raw('NOW()'),
28
+				'updated_at' => \DB::raw('NOW()')
29
+				],
30
+				[
31
+				'name'       => 'find',
32
+				'model'      => 'oauthClient',
33
+				'created_at' => \DB::raw('NOW()'),
34
+				'updated_at' => \DB::raw('NOW()')
35
+				],
36
+				[
37
+				'name'       => 'insert',
38
+				'model'      => 'oauthClient',
39
+				'created_at' => \DB::raw('NOW()'),
40
+				'updated_at' => \DB::raw('NOW()')
41
+				],
42
+				[
43
+				'name'       => 'update',
44
+				'model'      => 'oauthClient',
45
+				'created_at' => \DB::raw('NOW()'),
46
+				'updated_at' => \DB::raw('NOW()')
47
+				],
48
+				[
49
+				'name'       => 'revoke',
50
+				'model'      => 'oauthClient',
51
+				'created_at' => \DB::raw('NOW()'),
52
+				'updated_at' => \DB::raw('NOW()')
53
+				],
54
+				[
55
+				'name'       => 'unRevoke',
56
+				'model'      => 'oauthClient',
57
+				'created_at' => \DB::raw('NOW()'),
58
+				'updated_at' => \DB::raw('NOW()')
59
+				],
60
+			]
61
+		);
62
+	}
63 63
 }
Please login to merge, or discard this patch.
src/Modules/OauthClients/Database/Seeds/AssignRelationsSeeder.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 AssignRelationsSeeder extends Seeder
8 8
 {
9
-    /**
10
-     * Run the database seeds.
11
-     *
12
-     * @return void
13
-     */
14
-    public function run()
15
-    {
16
-        $adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id;
9
+	/**
10
+	 * Run the database seeds.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function run()
15
+	{
16
+		$adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id;
17 17
 
18
-        /**
19
-         * Assign the permissions to the admin group.
20
-         */
21
-        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['oauthClient'])->each(function ($permission) use ($adminGroupId) {
22
-            \DB::table('groups_permissions')->insert(
23
-                [
24
-                'permission_id' => $permission->id,
25
-                'group_id'      => $adminGroupId,
26
-                'created_at'    => \DB::raw('NOW()'),
27
-                'updated_at'    => \DB::raw('NOW()')
28
-                ]
29
-            );
30
-        });
31
-    }
18
+		/**
19
+		 * Assign the permissions to the admin group.
20
+		 */
21
+		\DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['oauthClient'])->each(function ($permission) use ($adminGroupId) {
22
+			\DB::table('groups_permissions')->insert(
23
+				[
24
+				'permission_id' => $permission->id,
25
+				'group_id'      => $adminGroupId,
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.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
         /**
19 19
          * Assign the permissions to the admin group.
20 20
          */
21
-        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['oauthClient'])->each(function ($permission) use ($adminGroupId) {
21
+        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['oauthClient'])->each(function($permission) use ($adminGroupId) {
22 22
             \DB::table('groups_permissions')->insert(
23 23
                 [
24 24
                 'permission_id' => $permission->id,
Please login to merge, or discard this patch.
src/Modules/OauthClients/Database/Seeds/OauthClientsDatabaseSeeder.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -6,15 +6,15 @@
 block discarded – undo
6 6
 
7 7
 class OauthClientsDatabaseSeeder 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(OauthClientsTableSeeder::class);
18
-        $this->call(AssignRelationsSeeder::class);
19
-    }
9
+	/**
10
+	 * Run the database seeds.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function run()
15
+	{
16
+		$this->call(ClearDataSeeder::class);
17
+		$this->call(OauthClientsTableSeeder::class);
18
+		$this->call(AssignRelationsSeeder::class);
19
+	}
20 20
 }
Please login to merge, or discard this patch.
src/Modules/OauthClients/Database/Seeds/ClearDataSeeder.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -6,15 +6,15 @@
 block discarded – undo
6 6
 
7 7
 class ClearDataSeeder extends Seeder
8 8
 {
9
-    /**
10
-     * Run the database seeds.
11
-     *
12
-     * @return void
13
-     */
14
-    public function run()
15
-    {
16
-        $permissions = \DB::table('permissions')->whereIn('model', ['oauthClient']);
17
-        \DB::table('groups_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete();
18
-        $permissions->delete();
19
-    }
9
+	/**
10
+	 * Run the database seeds.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function run()
15
+	{
16
+		$permissions = \DB::table('permissions')->whereIn('model', ['oauthClient']);
17
+		\DB::table('groups_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete();
18
+		$permissions->delete();
19
+	}
20 20
 }
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.
Database/Migrations/2016_06_01_000004_create_oauth_clients_table.php 2 patches
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.
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.
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.