Completed
Push — master ( 0f747c...09a64e )
by Sherif
01:52
created
src/Modules/Permissions/Http/Resources/Permission.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -7,24 +7,24 @@
 block discarded – undo
7 7
 
8 8
 class Permission extends JsonResource
9 9
 {
10
-    /**
11
-     * Transform the resource into an array.
12
-     *
13
-     * @param Request $request
14
-     * @return array
15
-     */
16
-    public function toArray($request)
17
-    {
18
-        if (! $this->resource) {
19
-            return [];
20
-        }
10
+	/**
11
+	 * Transform the resource into an array.
12
+	 *
13
+	 * @param Request $request
14
+	 * @return array
15
+	 */
16
+	public function toArray($request)
17
+	{
18
+		if (! $this->resource) {
19
+			return [];
20
+		}
21 21
 
22
-        return [
23
-            'id' => $this->id,
24
-            'name' => $this->name,
25
-            'roles' => RoleResource::collection($this->whenLoaded('roles')),
26
-            'created_at' => $this->created_at,
27
-            'updated_at' => $this->updated_at,
28
-        ];
29
-    }
22
+		return [
23
+			'id' => $this->id,
24
+			'name' => $this->name,
25
+			'roles' => RoleResource::collection($this->whenLoaded('roles')),
26
+			'created_at' => $this->created_at,
27
+			'updated_at' => $this->updated_at,
28
+		];
29
+	}
30 30
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
      */
18 18
     public function toArray($request)
19 19
     {
20
-        if (! $this->resource) {
20
+        if ( ! $this->resource) {
21 21
             return [];
22 22
         }
23 23
 
Please login to merge, or discard this patch.
src/Modules/Permissions/Repositories/PermissionRepository.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@
 block discarded – undo
5 5
 
6 6
 class PermissionRepository extends BaseRepository
7 7
 {
8
-    /**
9
-     * Init new object.
10
-     *
11
-     * @param   Permission $model
12
-     * @return  void
13
-     */
14
-    public function __construct(Permission $model)
15
-    {
16
-        parent::__construct($model);
17
-    }
8
+	/**
9
+	 * Init new object.
10
+	 *
11
+	 * @param   Permission $model
12
+	 * @return  void
13
+	 */
14
+	public function __construct(Permission $model)
15
+	{
16
+		parent::__construct($model);
17
+	}
18 18
 }
Please login to merge, or discard this patch.
src/Modules/Permissions/ModelObservers/PermissionObserver.php 1 patch
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -6,53 +6,53 @@
 block discarded – undo
6 6
 class PermissionObserver
7 7
 {
8 8
 
9
-    public function saving($model)
10
-    {
11
-        //
12
-    }
13
-
14
-    public function saved($model)
15
-    {
16
-        //
17
-    }
18
-
19
-    public function creating($model)
20
-    {
21
-        //
22
-    }
23
-
24
-    public function created($model)
25
-    {
26
-        //
27
-    }
28
-
29
-    public function updating($model)
30
-    {
31
-        //
32
-    }
33
-
34
-    public function updated($model)
35
-    {
36
-        //
37
-    }
38
-
39
-    public function deleting($model)
40
-    {
41
-        //
42
-    }
43
-
44
-    public function deleted($model)
45
-    {
46
-        //
47
-    }
48
-
49
-    public function restoring($model)
50
-    {
51
-        //
52
-    }
53
-
54
-    public function restored($model)
55
-    {
56
-        //
57
-    }
9
+	public function saving($model)
10
+	{
11
+		//
12
+	}
13
+
14
+	public function saved($model)
15
+	{
16
+		//
17
+	}
18
+
19
+	public function creating($model)
20
+	{
21
+		//
22
+	}
23
+
24
+	public function created($model)
25
+	{
26
+		//
27
+	}
28
+
29
+	public function updating($model)
30
+	{
31
+		//
32
+	}
33
+
34
+	public function updated($model)
35
+	{
36
+		//
37
+	}
38
+
39
+	public function deleting($model)
40
+	{
41
+		//
42
+	}
43
+
44
+	public function deleted($model)
45
+	{
46
+		//
47
+	}
48
+
49
+	public function restoring($model)
50
+	{
51
+		//
52
+	}
53
+
54
+	public function restored($model)
55
+	{
56
+		//
57
+	}
58 58
 }
Please login to merge, or discard this patch.
Database/Migrations/2016_01_24_111942_push_notification_devices.php 2 patches
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('push_notification_devices', function (Blueprint $table) {
15
+        Schema::create('push_notification_devices', function(Blueprint $table) {
16 16
             $table->increments('id');
17 17
             $table->string('device_token');
18 18
             $table->unsignedInteger('user_id');
Please login to merge, or discard this patch.
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -5,33 +5,33 @@
 block discarded – undo
5 5
 
6 6
 class PushNotificationDevices extends Migration
7 7
 {
8
-    /**
9
-     * Run the migrations.
10
-     *
11
-     * @return void
12
-     */
13
-    public function up()
14
-    {
15
-        Schema::create('push_notification_devices', function (Blueprint $table) {
16
-            $table->increments('id');
17
-            $table->string('device_token');
18
-            $table->unsignedInteger('user_id');
19
-            $table->text('access_token')->nullable();
20
-            $table->unique(array('device_token', 'user_id'));
21
-            $table->softDeletes();
22
-            $table->timestamps();
8
+	/**
9
+	 * Run the migrations.
10
+	 *
11
+	 * @return void
12
+	 */
13
+	public function up()
14
+	{
15
+		Schema::create('push_notification_devices', function (Blueprint $table) {
16
+			$table->increments('id');
17
+			$table->string('device_token');
18
+			$table->unsignedInteger('user_id');
19
+			$table->text('access_token')->nullable();
20
+			$table->unique(array('device_token', 'user_id'));
21
+			$table->softDeletes();
22
+			$table->timestamps();
23 23
             
24
-            $table->foreign('user_id')->references('id')->on('users');
25
-        });
26
-    }
24
+			$table->foreign('user_id')->references('id')->on('users');
25
+		});
26
+	}
27 27
 
28
-    /**
29
-     * Reverse the migrations.
30
-     *
31
-     * @return void
32
-     */
33
-    public function down()
34
-    {
35
-        Schema::dropIfExists('push_notification_devices');
36
-    }
28
+	/**
29
+	 * Reverse the migrations.
30
+	 *
31
+	 * @return void
32
+	 */
33
+	public function down()
34
+	{
35
+		Schema::dropIfExists('push_notification_devices');
36
+	}
37 37
 }
Please login to merge, or discard this patch.
Database/Migrations/2016_06_01_000004_create_oauth_auth_codes_table.php 2 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -6,33 +6,33 @@
 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->unsignedInteger('user_id');
19
-            $table->unsignedInteger('client_id');
20
-            $table->text('scopes')->nullable();
21
-            $table->boolean('revoked');
22
-            $table->dateTime('expires_at')->nullable();
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->unsignedInteger('user_id');
19
+			$table->unsignedInteger('client_id');
20
+			$table->text('scopes')->nullable();
21
+			$table->boolean('revoked');
22
+			$table->dateTime('expires_at')->nullable();
23 23
 
24
-            $table->foreign('user_id')->references('id')->on('users');
25
-            $table->foreign('client_id')->references('id')->on('oauth_clients');
26
-        });
27
-    }
24
+			$table->foreign('user_id')->references('id')->on('users');
25
+			$table->foreign('client_id')->references('id')->on('oauth_clients');
26
+		});
27
+	}
28 28
 
29
-    /**
30
-     * Reverse the migrations.
31
-     *
32
-     * @return void
33
-     */
34
-    public function down()
35
-    {
36
-        Schema::drop('oauth_auth_codes');
37
-    }
29
+	/**
30
+	 * Reverse the migrations.
31
+	 *
32
+	 * @return void
33
+	 */
34
+	public function down()
35
+	{
36
+		Schema::drop('oauth_auth_codes');
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_auth_codes', function (Blueprint $table) {
16
+        Schema::create('oauth_auth_codes', function(Blueprint $table) {
17 17
             $table->string('id', 100)->primary();
18 18
             $table->unsignedInteger('user_id');
19 19
             $table->unsignedInteger('client_id');
Please login to merge, or discard this patch.
Database/Migrations/2016_06_01_000001_create_oauth_clients_table.php 2 patches
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -6,35 +6,35 @@
 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->unsignedInteger('user_id')->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();
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->unsignedInteger('user_id')->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 26
 
27
-            $table->foreign('user_id')->references('id')->on('users');
28
-        });
29
-    }
27
+			$table->foreign('user_id')->references('id')->on('users');
28
+		});
29
+	}
30 30
 
31
-    /**
32
-     * Reverse the migrations.
33
-     *
34
-     * @return void
35
-     */
36
-    public function down()
37
-    {
38
-        Schema::drop('oauth_clients');
39
-    }
31
+	/**
32
+	 * Reverse the migrations.
33
+	 *
34
+	 * @return void
35
+	 */
36
+	public function down()
37
+	{
38
+		Schema::drop('oauth_clients');
39
+	}
40 40
 }
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->unsignedInteger('user_id')->nullable();
19 19
             $table->string('name');
Please login to merge, or discard this patch.
Database/Migrations/2016_06_01_000002_create_oauth_access_tokens_table.php 2 patches
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -6,35 +6,35 @@
 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->unsignedInteger('user_id')->nullable();
19
-            $table->unsignedInteger('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();
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->unsignedInteger('user_id')->nullable();
19
+			$table->unsignedInteger('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 25
 
26
-            $table->foreign('user_id')->references('id')->on('users');
27
-            $table->foreign('client_id')->references('id')->on('oauth_clients');
28
-        });
29
-    }
26
+			$table->foreign('user_id')->references('id')->on('users');
27
+			$table->foreign('client_id')->references('id')->on('oauth_clients');
28
+		});
29
+	}
30 30
 
31
-    /**
32
-     * Reverse the migrations.
33
-     *
34
-     * @return void
35
-     */
36
-    public function down()
37
-    {
38
-        Schema::drop('oauth_access_tokens');
39
-    }
31
+	/**
32
+	 * Reverse the migrations.
33
+	 *
34
+	 * @return void
35
+	 */
36
+	public function down()
37
+	{
38
+		Schema::drop('oauth_access_tokens');
39
+	}
40 40
 }
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->unsignedInteger('user_id')->nullable();
19 19
             $table->unsignedInteger('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   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -6,29 +6,29 @@
 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->unsignedInteger('client_id');
19
-            $table->timestamps();
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->unsignedInteger('client_id');
19
+			$table->timestamps();
20 20
             
21
-            $table->foreign('client_id')->references('id')->on('oauth_clients');
22
-        });
23
-    }
21
+			$table->foreign('client_id')->references('id')->on('oauth_clients');
22
+		});
23
+	}
24 24
 
25
-    /**
26
-     * Reverse the migrations.
27
-     *
28
-     * @return void
29
-     */
30
-    public function down()
31
-    {
32
-        Schema::drop('oauth_personal_access_clients');
33
-    }
25
+	/**
26
+	 * Reverse the migrations.
27
+	 *
28
+	 * @return void
29
+	 */
30
+	public function down()
31
+	{
32
+		Schema::drop('oauth_personal_access_clients');
33
+	}
34 34
 }
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->unsignedInteger('client_id');
19 19
             $table->timestamps();
Please login to merge, or discard this patch.
src/Modules/Roles/Services/RoleService.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
      *
22 22
      * @param  integer $roleId
23 23
      * @param  array   $permissionIds
24
-     * @return object
24
+     * @return boolean
25 25
      */
26 26
     public function assignPermissions($roleId, $permissionIds)
27 27
     {
Please login to merge, or discard this patch.
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -7,33 +7,33 @@
 block discarded – undo
7 7
 
8 8
 class RoleService extends BaseService
9 9
 {
10
-    /**
11
-     * Init new object.
12
-     *
13
-     * @param   RoleRepository $repo
14
-     * @return  void
15
-     */
16
-    public function __construct(RoleRepository $repo)
17
-    {
18
-        parent::__construct($repo);
19
-    }
10
+	/**
11
+	 * Init new object.
12
+	 *
13
+	 * @param   RoleRepository $repo
14
+	 * @return  void
15
+	 */
16
+	public function __construct(RoleRepository $repo)
17
+	{
18
+		parent::__construct($repo);
19
+	}
20 20
 
21
-    /**
22
-     * Assign the given permission ids to the given role.
23
-     *
24
-     * @param  integer $roleId
25
-     * @param  array   $permissionIds
26
-     * @return object
27
-     */
28
-    public function assignPermissions($roleId, $permissionIds)
29
-    {
30
-        $role = false;
31
-        \DB::transaction(function () use ($roleId, $permissionIds, &$role) {
32
-            $role = $this->repo->find($roleId);
33
-            $this->repo->detachPermissions($role);
34
-            $this->repo->attachPermissions($role, $permissionIds);
35
-        });
21
+	/**
22
+	 * Assign the given permission ids to the given role.
23
+	 *
24
+	 * @param  integer $roleId
25
+	 * @param  array   $permissionIds
26
+	 * @return object
27
+	 */
28
+	public function assignPermissions($roleId, $permissionIds)
29
+	{
30
+		$role = false;
31
+		\DB::transaction(function () use ($roleId, $permissionIds, &$role) {
32
+			$role = $this->repo->find($roleId);
33
+			$this->repo->detachPermissions($role);
34
+			$this->repo->attachPermissions($role, $permissionIds);
35
+		});
36 36
 
37
-        return $role;
38
-    }
37
+		return $role;
38
+	}
39 39
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
     public function assignPermissions($roleId, $permissionIds)
29 29
     {
30 30
         $role = false;
31
-        \DB::transaction(function () use ($roleId, $permissionIds, &$role) {
31
+        \DB::transaction(function() use ($roleId, $permissionIds, &$role) {
32 32
             $role = $this->repo->find($roleId);
33 33
             $this->repo->detachPermissions($role);
34 34
             $this->repo->attachPermissions($role, $permissionIds);
Please login to merge, or discard this patch.