Completed
Push — master ( ec2395...0dfd17 )
by Sherif
02:09
created
src/Modules/Groups/Http/Resources/AclGroup.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -8,25 +8,25 @@
 block discarded – undo
8 8
 
9 9
 class AclGroup extends JsonResource
10 10
 {
11
-    /**
12
-     * Transform the resource into an array.
13
-     *
14
-     * @param Request $request
15
-     * @return array
16
-     */
17
-    public function toArray($request)
18
-    {
19
-        if (! $this->resource) {
20
-            return [];
21
-        }
11
+	/**
12
+	 * Transform the resource into an array.
13
+	 *
14
+	 * @param Request $request
15
+	 * @return array
16
+	 */
17
+	public function toArray($request)
18
+	{
19
+		if (! $this->resource) {
20
+			return [];
21
+		}
22 22
 
23
-        return [
24
-            'id' => $this->id,
25
-            'name' => $this->name,
26
-            'users' => UserResource::collection($this->whenLoaded('users')),
27
-            'permissions' => PermissionResource::collection($this->whenLoaded('permissions')),
28
-            'created_at' => $this->created_at,
29
-            'updated_at' => $this->updated_at,
30
-        ];
31
-    }
23
+		return [
24
+			'id' => $this->id,
25
+			'name' => $this->name,
26
+			'users' => UserResource::collection($this->whenLoaded('users')),
27
+			'permissions' => PermissionResource::collection($this->whenLoaded('permissions')),
28
+			'created_at' => $this->created_at,
29
+			'updated_at' => $this->updated_at,
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
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
      */
17 17
     public function toArray($request)
18 18
     {
19
-        if (! $this->resource) {
19
+        if ( ! $this->resource) {
20 20
             return [];
21 21
         }
22 22
 
Please login to merge, or discard this patch.
src/Modules/Groups/Http/Controllers/GroupController.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -11,48 +11,48 @@
 block discarded – undo
11 11
 
12 12
 class GroupController extends BaseApiController
13 13
 {
14
-    /**
15
-     * Init new object.
16
-     *
17
-     * @param   GroupRepository $repo
18
-     * @param   CoreConfig      $config
19
-     * @return  void
20
-     */
21
-    public function __construct(GroupRepository $repo, CoreConfig $config)
22
-    {
23
-        parent::__construct($repo, $config, 'App\Modules\Groups\Http\Resources\AclGroup');
24
-    }
14
+	/**
15
+	 * Init new object.
16
+	 *
17
+	 * @param   GroupRepository $repo
18
+	 * @param   CoreConfig      $config
19
+	 * @return  void
20
+	 */
21
+	public function __construct(GroupRepository $repo, CoreConfig $config)
22
+	{
23
+		parent::__construct($repo, $config, 'App\Modules\Groups\Http\Resources\AclGroup');
24
+	}
25 25
 
26
-    /**
27
-     * Insert the given model to storage.
28
-     *
29
-     * @param InsertGroup $request
30
-     * @return \Illuminate\Http\Response
31
-     */
32
-    public function insert(InsertGroup $request)
33
-    {
34
-        return new $this->modelResource($this->repo->save($request->all()));
35
-    }
26
+	/**
27
+	 * Insert the given model to storage.
28
+	 *
29
+	 * @param InsertGroup $request
30
+	 * @return \Illuminate\Http\Response
31
+	 */
32
+	public function insert(InsertGroup $request)
33
+	{
34
+		return new $this->modelResource($this->repo->save($request->all()));
35
+	}
36 36
 
37
-    /**
38
-     * Update the given model to storage.
39
-     *
40
-     * @param UpdateGroup $request
41
-     * @return \Illuminate\Http\Response
42
-     */
43
-    public function update(UpdateGroup $request)
44
-    {
45
-        return new $this->modelResource($this->repo->save($request->all()));
46
-    }
37
+	/**
38
+	 * Update the given model to storage.
39
+	 *
40
+	 * @param UpdateGroup $request
41
+	 * @return \Illuminate\Http\Response
42
+	 */
43
+	public function update(UpdateGroup $request)
44
+	{
45
+		return new $this->modelResource($this->repo->save($request->all()));
46
+	}
47 47
 
48
-    /**
49
-     * Handle an assign permissions to group request.
50
-     *
51
-     * @param  AssignPermissions $request
52
-     * @return \Illuminate\Http\Response
53
-     */
54
-    public function assignPermissions(AssignPermissions $request)
55
-    {
56
-        return new $this->modelResource($this->repo->assignPermissions($request->get('group_id'), $request->get('permission_ids')));
57
-    }
48
+	/**
49
+	 * Handle an assign permissions to group request.
50
+	 *
51
+	 * @param  AssignPermissions $request
52
+	 * @return \Illuminate\Http\Response
53
+	 */
54
+	public function assignPermissions(AssignPermissions $request)
55
+	{
56
+		return new $this->modelResource($this->repo->assignPermissions($request->get('group_id'), $request->get('permission_ids')));
57
+	}
58 58
 }
Please login to merge, or discard this patch.
src/Modules/Groups/Http/Requests/AssignPermissions.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -6,26 +6,26 @@
 block discarded – undo
6 6
 
7 7
 class AssignPermissions extends FormRequest
8 8
 {
9
-    /**
10
-     * Determine if the user is authorized to make this request.
11
-     *
12
-     * @return bool
13
-     */
14
-    public function authorize()
15
-    {
16
-        return true;
17
-    }
9
+	/**
10
+	 * Determine if the user is authorized to make this request.
11
+	 *
12
+	 * @return bool
13
+	 */
14
+	public function authorize()
15
+	{
16
+		return true;
17
+	}
18 18
 
19
-    /**
20
-     * Get the validation rules that apply to the request.
21
-     *
22
-     * @return array
23
-     */
24
-    public function rules()
25
-    {
26
-        return [
27
-            'permission_ids' => 'required|exists:permissions,id',
28
-            'group_id'       => 'required|array|exists:groups,id'
29
-        ];
30
-    }
19
+	/**
20
+	 * Get the validation rules that apply to the request.
21
+	 *
22
+	 * @return array
23
+	 */
24
+	public function rules()
25
+	{
26
+		return [
27
+			'permission_ids' => 'required|exists:permissions,id',
28
+			'group_id'       => 'required|array|exists:groups,id'
29
+		];
30
+	}
31 31
 }
Please login to merge, or discard this patch.
src/Modules/Groups/Http/Requests/UpdateGroup.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -6,26 +6,26 @@
 block discarded – undo
6 6
 
7 7
 class UpdateGroup extends FormRequest
8 8
 {
9
-    /**
10
-     * Determine if the user is authorized to make this request.
11
-     *
12
-     * @return bool
13
-     */
14
-    public function authorize()
15
-    {
16
-        return true;
17
-    }
9
+	/**
10
+	 * Determine if the user is authorized to make this request.
11
+	 *
12
+	 * @return bool
13
+	 */
14
+	public function authorize()
15
+	{
16
+		return true;
17
+	}
18 18
 
19
-    /**
20
-     * Get the validation rules that apply to the request.
21
-     *
22
-     * @return array
23
-     */
24
-    public function rules()
25
-    {
26
-        return [
27
-            'id'   => 'required|exists:groups,id',
28
-            'name' => 'required|string|max:100|unique:groups,name,'.$this->get('id')
29
-        ];
30
-    }
19
+	/**
20
+	 * Get the validation rules that apply to the request.
21
+	 *
22
+	 * @return array
23
+	 */
24
+	public function rules()
25
+	{
26
+		return [
27
+			'id'   => 'required|exists:groups,id',
28
+			'name' => 'required|string|max:100|unique:groups,name,'.$this->get('id')
29
+		];
30
+	}
31 31
 }
Please login to merge, or discard this patch.
src/Modules/Groups/Http/Requests/InsertGroup.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -6,25 +6,25 @@
 block discarded – undo
6 6
 
7 7
 class InsertGroup extends FormRequest
8 8
 {
9
-    /**
10
-     * Determine if the user is authorized to make this request.
11
-     *
12
-     * @return bool
13
-     */
14
-    public function authorize()
15
-    {
16
-        return true;
17
-    }
9
+	/**
10
+	 * Determine if the user is authorized to make this request.
11
+	 *
12
+	 * @return bool
13
+	 */
14
+	public function authorize()
15
+	{
16
+		return true;
17
+	}
18 18
 
19
-    /**
20
-     * Get the validation rules that apply to the request.
21
-     *
22
-     * @return array
23
-     */
24
-    public function rules()
25
-    {
26
-        return [
27
-            'name' => 'required|string|max:100|unique:groups,name,'.$this->get('id')
28
-        ];
29
-    }
19
+	/**
20
+	 * Get the validation rules that apply to the request.
21
+	 *
22
+	 * @return array
23
+	 */
24
+	public function rules()
25
+	{
26
+		return [
27
+			'name' => 'required|string|max:100|unique:groups,name,'.$this->get('id')
28
+		];
29
+	}
30 30
 }
Please login to merge, or discard this patch.