Completed
Push — master ( 9ecb5e...97e3cb )
by Sherif
13:30
created
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
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');
23
-            $table->boolean('password_client');
24
-            $table->boolean('revoked');
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');
23
+			$table->boolean('password_client');
24
+			$table->boolean('revoked');
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.
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/Acl/Proxy/LoginProxy.php 1 patch
Indentation   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -5,107 +5,107 @@
 block discarded – undo
5 5
 
6 6
 class LoginProxy
7 7
 {
8
-    private $apiConsumer;
9
-
10
-    private $auth;
11
-
12
-    private $db;
13
-
14
-    private $request;
15
-
16
-    private $userRepository;
17
-
18
-    public function __construct(Application $app, UserRepository $userRepository) 
19
-    {
20
-
21
-        $this->userRepository = $userRepository;
22
-        $this->apiConsumer    = $app->make('apiconsumer');
23
-        $this->auth           = $app->make('auth');
24
-        $this->db             = $app->make('db');
25
-        $this->request        = $app->make('request');
26
-    }
27
-
28
-    /**
29
-     * Attempt to create an access token using user credentials.
30
-     *
31
-     * @param  array   $credentials
32
-     * @param  boolean $adminLogin
33
-     * @return array
34
-     */
35
-    public function login($credentials, $adminLogin = false)
36
-    {
37
-        $user = $this->userRepository->login($credentials, $adminLogin);
38
-
39
-        return $this->proxy('password', [
40
-            'username' => $credentials['email'],
41
-            'password' => $credentials['password']
42
-        ]);
43
-
44
-        \ErrorHandler::loginFailed();
45
-    }
46
-
47
-    /**
48
-     * Attempt to refresh the access token useing the given refresh token.
49
-     * 
50
-     * @param  string $refreshToken
51
-     * @return array
52
-     */
53
-    public function refreshtoken($refreshToken)
54
-    {
55
-        return $this->proxy('refresh_token', [
56
-            'refresh_token' => $refreshToken
57
-        ]);
58
-    }
59
-
60
-    /**
61
-     * Proxy a request to the OAuth server.
62
-     *
63
-     * @param string $grantType what type of grant type should be proxied
64
-     * @param array 
65
-     */
66
-    public function proxy($grantType, array $data = [])
67
-    {
68
-        $data = array_merge($data, [
69
-            'client_id'     => env('PASSWORD_CLIENT_ID'),
70
-            'client_secret' => env('PASSWORD_CLIENT_SECRET'),
71
-            'grant_type'    => $grantType
72
-        ]);
73
-
74
-        $response = $this->apiConsumer->post('/oauth/token', $data);
75
-
76
-        if ( ! $response->isSuccessful()) 
77
-        {
78
-            if ($grantType == 'refresh_token') 
79
-            {
80
-                \ErrorHandler::invalidRefreshToken();
81
-            }
82
-
83
-            \ErrorHandler::loginFailed();
84
-        }
85
-
86
-        $data = json_decode($response->getContent());
87
-
88
-        return [
89
-            'access_token'  => $data->access_token,
90
-            'refresh_token' => $data->refresh_token,
91
-            'expires_in'    => $data->expires_in
92
-        ];
93
-    }
94
-
95
-    /**
96
-     * Logs out the user. We revoke access token and refresh token.
97
-     */
98
-    public function logout()
99
-    {
100
-        $accessToken = $this->auth->user()->token();
101
-
102
-        $refreshToken = $this->db
103
-            ->table('oauth_refresh_tokens')
104
-            ->where('access_token_id', $accessToken->id)
105
-            ->update([
106
-                'revoked' => true
107
-            ]);
108
-
109
-        $accessToken->revoke();
110
-    }
8
+	private $apiConsumer;
9
+
10
+	private $auth;
11
+
12
+	private $db;
13
+
14
+	private $request;
15
+
16
+	private $userRepository;
17
+
18
+	public function __construct(Application $app, UserRepository $userRepository) 
19
+	{
20
+
21
+		$this->userRepository = $userRepository;
22
+		$this->apiConsumer    = $app->make('apiconsumer');
23
+		$this->auth           = $app->make('auth');
24
+		$this->db             = $app->make('db');
25
+		$this->request        = $app->make('request');
26
+	}
27
+
28
+	/**
29
+	 * Attempt to create an access token using user credentials.
30
+	 *
31
+	 * @param  array   $credentials
32
+	 * @param  boolean $adminLogin
33
+	 * @return array
34
+	 */
35
+	public function login($credentials, $adminLogin = false)
36
+	{
37
+		$user = $this->userRepository->login($credentials, $adminLogin);
38
+
39
+		return $this->proxy('password', [
40
+			'username' => $credentials['email'],
41
+			'password' => $credentials['password']
42
+		]);
43
+
44
+		\ErrorHandler::loginFailed();
45
+	}
46
+
47
+	/**
48
+	 * Attempt to refresh the access token useing the given refresh token.
49
+	 * 
50
+	 * @param  string $refreshToken
51
+	 * @return array
52
+	 */
53
+	public function refreshtoken($refreshToken)
54
+	{
55
+		return $this->proxy('refresh_token', [
56
+			'refresh_token' => $refreshToken
57
+		]);
58
+	}
59
+
60
+	/**
61
+	 * Proxy a request to the OAuth server.
62
+	 *
63
+	 * @param string $grantType what type of grant type should be proxied
64
+	 * @param array 
65
+	 */
66
+	public function proxy($grantType, array $data = [])
67
+	{
68
+		$data = array_merge($data, [
69
+			'client_id'     => env('PASSWORD_CLIENT_ID'),
70
+			'client_secret' => env('PASSWORD_CLIENT_SECRET'),
71
+			'grant_type'    => $grantType
72
+		]);
73
+
74
+		$response = $this->apiConsumer->post('/oauth/token', $data);
75
+
76
+		if ( ! $response->isSuccessful()) 
77
+		{
78
+			if ($grantType == 'refresh_token') 
79
+			{
80
+				\ErrorHandler::invalidRefreshToken();
81
+			}
82
+
83
+			\ErrorHandler::loginFailed();
84
+		}
85
+
86
+		$data = json_decode($response->getContent());
87
+
88
+		return [
89
+			'access_token'  => $data->access_token,
90
+			'refresh_token' => $data->refresh_token,
91
+			'expires_in'    => $data->expires_in
92
+		];
93
+	}
94
+
95
+	/**
96
+	 * Logs out the user. We revoke access token and refresh token.
97
+	 */
98
+	public function logout()
99
+	{
100
+		$accessToken = $this->auth->user()->token();
101
+
102
+		$refreshToken = $this->db
103
+			->table('oauth_refresh_tokens')
104
+			->where('access_token_id', $accessToken->id)
105
+			->update([
106
+				'revoked' => true
107
+			]);
108
+
109
+		$accessToken->revoke();
110
+	}
111 111
 }
112 112
\ No newline at end of file
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.
src/Modules/V1/Core/Database/Seeds/AssignRelationsSeeder.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -6,20 +6,20 @@  discard block
 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', ['settings'])->each(function ($permission) use ($adminGroupId) {
22
-        	\DB::table('groups_permissions')->insert(
18
+		/**
19
+		 * Assign the permissions to the admin group.
20
+		 */
21
+		\DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['settings'])->each(function ($permission) use ($adminGroupId) {
22
+			\DB::table('groups_permissions')->insert(
23 23
 				[
24 24
 				'permission_id' => $permission->id,
25 25
 				'group_id'      => $adminGroupId,
@@ -27,6 +27,6 @@  discard block
 block discarded – undo
27 27
 				'updated_at'    => \DB::raw('NOW()')
28 28
 				]
29 29
 			);
30
-        });
31
-    }
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', ['settings'])->each(function ($permission) use ($adminGroupId) {
21
+        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['settings'])->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/V1/Core/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', ['settings']);
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', ['settings']);
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.
src/Modules/V1/Core/Database/Seeds/CoreDatabaseSeeder.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 CoreDatabaseSeeder 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(SettingsTableSeeder::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(SettingsTableSeeder::class);
18
+		$this->call(AssignRelationsSeeder::class);
19
+	}
20 20
 }
Please login to merge, or discard this patch.
V1/Notifications/Http/Controllers/PushNotificationsDevicesController.php 2 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -7,42 +7,42 @@
 block discarded – undo
7 7
 
8 8
 class PushNotificationsDevicesController extends BaseApiController
9 9
 {
10
-    /**
11
-     * The name of the model that is used by the base api controller 
12
-     * to preform actions like (add, edit ... etc).
13
-     * @var string
14
-     */
15
-    protected $model            = 'pushNotificationDevices';
10
+	/**
11
+	 * The name of the model that is used by the base api controller 
12
+	 * to preform actions like (add, edit ... etc).
13
+	 * @var string
14
+	 */
15
+	protected $model            = 'pushNotificationDevices';
16 16
 
17
-    /**
18
-     * List of all route actions that the base api controller
19
-     * will skip permissions check for them.
20
-     * @var array
21
-     */
22
-    protected $skipPermissionCheck = ['registerDevice'];
17
+	/**
18
+	 * List of all route actions that the base api controller
19
+	 * will skip permissions check for them.
20
+	 * @var array
21
+	 */
22
+	protected $skipPermissionCheck = ['registerDevice'];
23 23
 
24
-    /**
25
-     * The validations rules used by the base api controller
26
-     * to check before add.
27
-     * @var array
28
-     */
29
-    protected $validationRules  = [
30
-    'device_token' => 'required|string|max:255',
31
-    'user_id'      => 'required|exists:users,id'
32
-    ];
24
+	/**
25
+	 * The validations rules used by the base api controller
26
+	 * to check before add.
27
+	 * @var array
28
+	 */
29
+	protected $validationRules  = [
30
+	'device_token' => 'required|string|max:255',
31
+	'user_id'      => 'required|exists:users,id'
32
+	];
33 33
 
34
-    /**
35
-     * Register the given device to the logged in user.
36
-     *
37
-     * @param  \Illuminate\Http\Request  $request
38
-     * @return \Illuminate\Http\Response
39
-     */
40
-    public function registerDevice(Request $request)
41
-    {
42
-        $this->validate($request, [
43
-            'device_token' => 'required|string|max:255'
44
-            ]);
34
+	/**
35
+	 * Register the given device to the logged in user.
36
+	 *
37
+	 * @param  \Illuminate\Http\Request  $request
38
+	 * @return \Illuminate\Http\Response
39
+	 */
40
+	public function registerDevice(Request $request)
41
+	{
42
+		$this->validate($request, [
43
+			'device_token' => 'required|string|max:255'
44
+			]);
45 45
 
46
-        return \Response::json($this->repo->registerDevice($request->all()), 200);
47
-    }
46
+		return \Response::json($this->repo->registerDevice($request->all()), 200);
47
+	}
48 48
 }
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
      * to preform actions like (add, edit ... etc).
13 13
      * @var string
14 14
      */
15
-    protected $model            = 'pushNotificationDevices';
15
+    protected $model = 'pushNotificationDevices';
16 16
 
17 17
     /**
18 18
      * List of all route actions that the base api controller
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      * to check before add.
27 27
      * @var array
28 28
      */
29
-    protected $validationRules  = [
29
+    protected $validationRules = [
30 30
     'device_token' => 'required|string|max:255',
31 31
     'user_id'      => 'required|exists:users,id'
32 32
     ];
Please login to merge, or discard this patch.