Passed
Push — master ( 7f95c4...261678 )
by Rodinei
11:20
created
app/PasswordResetApi.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 
7 7
 class PasswordResetApi extends Model
8 8
 {
9
-	protected $table = 'password_resets_api';
9
+    protected $table = 'password_resets_api';
10 10
 
11 11
     protected $fillable = ['email', 'token'];
12 12
 }
Please login to merge, or discard this patch.
app/Http/Controllers/Api/v1/AuthController.php 1 patch
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -8,9 +8,9 @@  discard block
 block discarded – undo
8 8
 
9 9
 class AuthController extends Controller
10 10
 {
11
-	private $model;
11
+    private $model;
12 12
 
13
-	/**
13
+    /**
14 14
      * Create a new controller instance.
15 15
      *
16 16
      * @return void
@@ -20,37 +20,37 @@  discard block
 block discarded – undo
20 20
         $this->model = $model;
21 21
     }
22 22
 
23
-	public function profile(Request $request)
24
-	{
25
-		$user = $this->model->where('id', $request->user()->id)->first();
23
+    public function profile(Request $request)
24
+    {
25
+        $user = $this->model->where('id', $request->user()->id)->first();
26 26
 
27
-		if (!$user) {
28
-			return response()->json(['status' => 'error', 'message' => 'Opss. Usuário não foi encontrado, favor verifique se esta logado.']);
29
-		}
27
+        if (!$user) {
28
+            return response()->json(['status' => 'error', 'message' => 'Opss. Usuário não foi encontrado, favor verifique se esta logado.']);
29
+        }
30 30
     
31 31
     //$user->image = asset($user->image);
32 32
 
33
-		return response()->json(['status' => 'success', 'data' => $user]);
34
-	}
33
+        return response()->json(['status' => 'success', 'data' => $user]);
34
+    }
35 35
   
36
-  public function profileUpdate(Request $request)
37
-	{
38
-		$user = User::where('id', $request->user()->id)->first();
36
+    public function profileUpdate(Request $request)
37
+    {
38
+        $user = User::where('id', $request->user()->id)->first();
39 39
 
40
-		if (!$user) {
41
-			return response()->json(['status' => 'error', 'message' => 'Opss. Usuário não foi encontrado, favor verifique se esta logado.']);
42
-		}
40
+        if (!$user) {
41
+            return response()->json(['status' => 'error', 'message' => 'Opss. Usuário não foi encontrado, favor verifique se esta logado.']);
42
+        }
43 43
     
44 44
     $rules = [
45 45
         'name' => 'required',
46
-    		'email' => 'required|email|unique:users,email,' . $request->user()->id,
47
-    		'password' => 'required|string|min:6|confirmed',
46
+            'email' => 'required|email|unique:users,email,' . $request->user()->id,
47
+            'password' => 'required|string|min:6|confirmed',
48 48
     ];
49 49
 
50
-		$validator = \Validator::make($request->all(), $rules);
50
+        $validator = \Validator::make($request->all(), $rules);
51 51
 
52 52
     if ($validator->fails()) {
53
-       return response()->json(['status' => 'error', 'errors' => $validator->errors()]);
53
+        return response()->json(['status' => 'error', 'errors' => $validator->errors()]);
54 54
     }
55 55
     
56 56
     /*
@@ -59,41 +59,41 @@  discard block
 block discarded – undo
59 59
 		}
60 60
     */
61 61
 
62
-		$data = [
63
-			'name' => $request->input('name'),
64
-      'email' => $request->input('email'),
65
-      'password' => bcrypt($request->input('password')),
66
-		];
62
+        $data = [
63
+            'name' => $request->input('name'),
64
+        'email' => $request->input('email'),
65
+        'password' => bcrypt($request->input('password')),
66
+        ];
67 67
     
68 68
     if ($request->image) {
69
-      $time = time();
70
-      $directoryPai = 'profiles';
71
-      $directoryImage = $directoryPai . DIRECTORY_SEPARATOR . 'profile_id_' . $user->id;
72
-      $ext = substr($request->image, 11, strpos($request->image, ';') - 11);
73
-      $urlImage = $directoryImage . DIRECTORY_SEPARATOR . $time . '.' . $ext;
74
-      $file = str_replace('data:image/' . $ext . ';base64,', '', $request->image);
75
-      $file = base64_decode($file);
69
+        $time = time();
70
+        $directoryPai = 'profiles';
71
+        $directoryImage = $directoryPai . DIRECTORY_SEPARATOR . 'profile_id_' . $user->id;
72
+        $ext = substr($request->image, 11, strpos($request->image, ';') - 11);
73
+        $urlImage = $directoryImage . DIRECTORY_SEPARATOR . $time . '.' . $ext;
74
+        $file = str_replace('data:image/' . $ext . ';base64,', '', $request->image);
75
+        $file = base64_decode($file);
76 76
       
77
-      if (!file_exists($directoryPai)) {
77
+        if (!file_exists($directoryPai)) {
78 78
         mkdir($directoryPai, 0777);
79
-      }
80
-      if ($user->image) {
79
+        }
80
+        if ($user->image) {
81 81
         $imgUser = str_replace(asset('/'), '', $user->image);
82 82
         if (file_exists($imgUser)) {
83
-          unlink($imgUser);
83
+            unlink($imgUser);
84
+        }
84 85
         }
85
-      }
86
-      if (!file_exists($directoryImage)) {
86
+        if (!file_exists($directoryImage)) {
87 87
         mkdir($directoryImage, 0777);
88
-      }
88
+        }
89 89
       
90
-      file_put_contents($urlImage, $file);
91
-      $data['image'] = $urlImage;
90
+        file_put_contents($urlImage, $file);
91
+        $data['image'] = $urlImage;
92 92
     }
93 93
     
94
-		$user->update($data);
94
+        $user->update($data);
95 95
     //$user->image = asset($user->image);
96 96
 
97
-		return response()->json(['status' => 'success', 'data' => $user]);
98
-	}
97
+        return response()->json(['status' => 'success', 'data' => $user]);
98
+    }
99 99
 }
100 100
\ No newline at end of file
Please login to merge, or discard this patch.
app/Http/Controllers/Api/v1/BillReceiveController.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -8,9 +8,9 @@  discard block
 block discarded – undo
8 8
 
9 9
 class BillReceiveController extends Controller
10 10
 {
11
-	private $model;
11
+    private $model;
12 12
 
13
-	/**
13
+    /**
14 14
      * Create a new controller instance.
15 15
      *
16 16
      * @return void
@@ -24,13 +24,13 @@  discard block
 block discarded – undo
24 24
     {
25 25
         $user = $this->model->where('id', $request->user()->id)->first();
26 26
 
27
-		if (!$user) {
28
-			return response()->json(['status' => 'error', 'message' => 'Opss. Usuário não foi encontrado, favor verifique se esta logado.']);
29
-		}
27
+        if (!$user) {
28
+            return response()->json(['status' => 'error', 'message' => 'Opss. Usuário não foi encontrado, favor verifique se esta logado.']);
29
+        }
30 30
 
31
-		$bill_receives = $user->bill_receives()->with('category')->get();
31
+        $bill_receives = $user->bill_receives()->with('category')->get();
32 32
 
33
-		return response()->json(['status' => 'success', 'data' => $bill_receives]);
33
+        return response()->json(['status' => 'success', 'data' => $bill_receives]);
34 34
     }
35 35
 
36 36
     public function store(Request $request)
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         $validator = \Validator::make($request->all(), $rules);
47 47
 
48 48
         if ($validator->fails()) {
49
-           return response()->json(['status' => 'error', 'errors' => $validator->errors()], 422);
49
+            return response()->json(['status' => 'error', 'errors' => $validator->errors()], 422);
50 50
         }
51 51
 
52 52
         $user = $this->model->where('id', $request->user()->id)->first();
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     public function show(Request $request, $id)
64 64
     {
65 65
         if (!$id) {
66
-           return response()->json(['status' => 'error', 'message' => 'Conta a receber não informada']);
66
+            return response()->json(['status' => 'error', 'message' => 'Conta a receber não informada']);
67 67
         }
68 68
 
69 69
         $user = $this->model->where('id', $request->user()->id)->first();
@@ -94,11 +94,11 @@  discard block
 block discarded – undo
94 94
         $validator = \Validator::make($request->all(), $rules);
95 95
 
96 96
         if ($validator->fails()) {
97
-           return response()->json(['status' => 'error', 'errors' => $validator->errors()], 422);
97
+            return response()->json(['status' => 'error', 'errors' => $validator->errors()], 422);
98 98
         }
99 99
         
100 100
         if (!$id) {
101
-           return response()->json(['status' => 'error', 'message' => 'Conta a receber não informada']);
101
+            return response()->json(['status' => 'error', 'message' => 'Conta a receber não informada']);
102 102
         }
103 103
 
104 104
         $user = $this->model->where('id', $request->user()->id)->first();
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
         $validator = \Validator::make($request->all(), $rules);
128 128
 
129 129
         if ($validator->fails()) {
130
-           return response()->json(['status' => 'error', 'errors' => $validator->errors()], 422);
130
+            return response()->json(['status' => 'error', 'errors' => $validator->errors()], 422);
131 131
         }
132 132
         
133 133
         if (!$id) {
134
-           return response()->json(['status' => 'error', 'message' => 'Conta a receber não informada']);
134
+            return response()->json(['status' => 'error', 'message' => 'Conta a receber não informada']);
135 135
         }
136 136
 
137 137
         $user = $this->model->where('id', $request->user()->id)->first();
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
     public function destroy(Request $request, $id)
155 155
     {
156 156
         if (!$id) {
157
-           return response()->json(['status' => 'error', 'message' => 'Conta a receber não informada']);
157
+            return response()->json(['status' => 'error', 'message' => 'Conta a receber não informada']);
158 158
         }
159 159
 
160 160
         $user = $this->model->where('id', $request->user()->id)->first();
Please login to merge, or discard this patch.
app/Http/Controllers/Api/v1/BillPayController.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -8,9 +8,9 @@  discard block
 block discarded – undo
8 8
 
9 9
 class BillPayController extends Controller
10 10
 {
11
-	private $model;
11
+    private $model;
12 12
 
13
-	/**
13
+    /**
14 14
      * Create a new controller instance.
15 15
      *
16 16
      * @return void
@@ -24,13 +24,13 @@  discard block
 block discarded – undo
24 24
     {
25 25
         $user = $this->model->where('id', $request->user()->id)->first();
26 26
 
27
-		if (!$user) {
28
-			return response()->json(['status' => 'error', 'message' => 'Opss. Usuário não foi encontrado, favor verifique se esta logado.']);
29
-		}
27
+        if (!$user) {
28
+            return response()->json(['status' => 'error', 'message' => 'Opss. Usuário não foi encontrado, favor verifique se esta logado.']);
29
+        }
30 30
 
31
-		$bill_pays = $user->bill_pays()->with('category')->get();
31
+        $bill_pays = $user->bill_pays()->with('category')->get();
32 32
 
33
-		return response()->json(['status' => 'success', 'data' => $bill_pays]);
33
+        return response()->json(['status' => 'success', 'data' => $bill_pays]);
34 34
     }
35 35
 
36 36
     public function store(Request $request)
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         $validator = \Validator::make($request->all(), $rules);
46 46
 
47 47
         if ($validator->fails()) {
48
-           return response()->json(['status' => 'error', 'errors' => $validator->errors()], 422);
48
+            return response()->json(['status' => 'error', 'errors' => $validator->errors()], 422);
49 49
         }
50 50
 
51 51
         $user = $this->model->where('id', $request->user()->id)->first();
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     public function show(Request $request, $id)
63 63
     {
64 64
         if (!$id) {
65
-           return response()->json(['status' => 'error', 'message' => 'Conta a pagar não informada']);
65
+            return response()->json(['status' => 'error', 'message' => 'Conta a pagar não informada']);
66 66
         }
67 67
 
68 68
         $user = $this->model->where('id', $request->user()->id)->first();
@@ -93,11 +93,11 @@  discard block
 block discarded – undo
93 93
         $validator = \Validator::make($request->all(), $rules);
94 94
 
95 95
         if ($validator->fails()) {
96
-           return response()->json(['status' => 'error', 'errors' => $validator->errors()], 422);
96
+            return response()->json(['status' => 'error', 'errors' => $validator->errors()], 422);
97 97
         }
98 98
 
99 99
         if (!$id) {
100
-           return response()->json(['status' => 'error', 'message' => 'Conta a pagar não informada']);
100
+            return response()->json(['status' => 'error', 'message' => 'Conta a pagar não informada']);
101 101
         }
102 102
 
103 103
         $user = $this->model->where('id', $request->user()->id)->first();
@@ -126,11 +126,11 @@  discard block
 block discarded – undo
126 126
         $validator = \Validator::make($request->all(), $rules);
127 127
 
128 128
         if ($validator->fails()) {
129
-           return response()->json(['status' => 'error', 'errors' => $validator->errors()], 422);
129
+            return response()->json(['status' => 'error', 'errors' => $validator->errors()], 422);
130 130
         }
131 131
 
132 132
         if (!$id) {
133
-           return response()->json(['status' => 'error', 'message' => 'Conta a pagar não informada']);
133
+            return response()->json(['status' => 'error', 'message' => 'Conta a pagar não informada']);
134 134
         }
135 135
 
136 136
         $user = $this->model->where('id', $request->user()->id)->first();
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
     public function destroy(Request $request, $id)
154 154
     {
155 155
         if (!$id) {
156
-           return response()->json(['status' => 'error', 'message' => 'Conta a pagar não informada']);
156
+            return response()->json(['status' => 'error', 'message' => 'Conta a pagar não informada']);
157 157
         }
158 158
 
159 159
         $user = $this->model->where('id', $request->user()->id)->first();
Please login to merge, or discard this patch.
app/Http/Controllers/Api/v1/CategoryController.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -8,9 +8,9 @@  discard block
 block discarded – undo
8 8
 
9 9
 class CategoryController extends Controller
10 10
 {
11
-	private $model;
11
+    private $model;
12 12
 
13
-	/**
13
+    /**
14 14
      * Create a new controller instance.
15 15
      *
16 16
      * @return void
@@ -24,13 +24,13 @@  discard block
 block discarded – undo
24 24
     {
25 25
         $user = $this->model->where('id', $request->user()->id)->first();
26 26
 
27
-		if (!$user) {
28
-			return response()->json(['status' => 'error', 'message' => 'Opss. Usuário não foi encontrado, favor verifique se esta logado.']);
29
-		}
27
+        if (!$user) {
28
+            return response()->json(['status' => 'error', 'message' => 'Opss. Usuário não foi encontrado, favor verifique se esta logado.']);
29
+        }
30 30
 
31
-		$categories = $user->categories()->get();
31
+        $categories = $user->categories()->get();
32 32
 
33
-		return response()->json(['status' => 'success', 'data' => $categories]);
33
+        return response()->json(['status' => 'success', 'data' => $categories]);
34 34
     }
35 35
 
36 36
     public function store(Request $request)
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         $validator = \Validator::make($request->all(), $rules);
43 43
 
44 44
         if ($validator->fails()) {
45
-           return response()->json(['status' => 'error', 'errors' => $validator->errors()], 422);
45
+            return response()->json(['status' => 'error', 'errors' => $validator->errors()], 422);
46 46
         }
47 47
 
48 48
         $user = $this->model->where('id', $request->user()->id)->first();
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     public function show(Request $request, $id)
60 60
     {
61 61
         if (!$id) {
62
-           return response()->json(['status' => 'error', 'message' => 'Categoria não informada']);
62
+            return response()->json(['status' => 'error', 'message' => 'Categoria não informada']);
63 63
         }
64 64
 
65 65
         $user = $this->model->where('id', $request->user()->id)->first();
@@ -86,11 +86,11 @@  discard block
 block discarded – undo
86 86
         $validator = \Validator::make($request->all(), $rules);
87 87
 
88 88
         if ($validator->fails()) {
89
-           return response()->json(['status' => 'error', 'errors' => $validator->errors()], 422);
89
+            return response()->json(['status' => 'error', 'errors' => $validator->errors()], 422);
90 90
         }
91 91
         
92 92
         if (!$id) {
93
-           return response()->json(['status' => 'error', 'message' => 'Categoria não informada']);
93
+            return response()->json(['status' => 'error', 'message' => 'Categoria não informada']);
94 94
         }
95 95
 
96 96
         $user = $this->model->where('id', $request->user()->id)->first();
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     public function destroy(Request $request, $id)
114 114
     {
115 115
         if (!$id) {
116
-           return response()->json(['status' => 'error', 'message' => 'Categoria não informada']);
116
+            return response()->json(['status' => 'error', 'message' => 'Categoria não informada']);
117 117
         }
118 118
 
119 119
         $user = $this->model->where('id', $request->user()->id)->first();
Please login to merge, or discard this patch.
app/Http/Controllers/Api/v1/ContentController.php 1 patch
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@  discard block
 block discarded – undo
9 9
 
10 10
 class ContentController extends Controller
11 11
 {
12
-	private $model;
13
-  private $contentModel;
12
+    private $model;
13
+    private $contentModel;
14 14
 
15
-	/**
15
+    /**
16 16
      * Create a new controller instance.
17 17
      *
18 18
      * @return void
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         $user = $this->model->where('id', $request->user()->id)->first();
29 29
 
30 30
         if (!$user) {
31
-          return response()->json(['status' => 'error', 'message' => 'Opss. Usuário não foi encontrado, favor verifique se esta logado.']);
31
+            return response()->json(['status' => 'error', 'message' => 'Opss. Usuário não foi encontrado, favor verifique se esta logado.']);
32 32
         }
33 33
       
34 34
         //$contents = $this->contentModel->with('user')->orderBy('published_at','DESC')->paginate(5);
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
         $contents = $this->contentModel->whereIn('user_id', $friends)->with('user')->orderBy('published_at','DESC')->paginate(5);
39 39
       
40 40
         foreach($contents as $key => $content) {
41
-          $content->total_likes = $content->likes()->count();
42
-          $content->comments = $content->comments()->with('user')->orderBy('created_at', 'DESC')->get();
43
-          $content->user_like_content = $user->likes()->find($content->id) ? true : false;
41
+            $content->total_likes = $content->likes()->count();
42
+            $content->comments = $content->comments()->with('user')->orderBy('created_at', 'DESC')->get();
43
+            $content->user_like_content = $user->likes()->find($content->id) ? true : false;
44 44
         }
45 45
 
46 46
         return response()->json(['status' => 'success', 'data' => $contents]);
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         $validator = \Validator::make($request->all(), $rules);
57 57
 
58 58
         if ($validator->fails()) {
59
-           return response()->json(['status' => 'error', 'errors' => $validator->errors()]);
59
+            return response()->json(['status' => 'error', 'errors' => $validator->errors()]);
60 60
         }
61 61
 
62 62
         $user = $this->model->where('id', $request->user()->id)->first();
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     public function show(Request $request, $id)
81 81
     {
82 82
         if (!$id) {
83
-           return response()->json(['status' => 'error', 'message' => 'Conteúdo não informada']);
83
+            return response()->json(['status' => 'error', 'message' => 'Conteúdo não informada']);
84 84
         }
85 85
 
86 86
         $user = $this->model->where('id', $request->user()->id)->first();
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
         $validator = \Validator::make($request->all(), $rules);
108 108
 
109 109
         if ($validator->fails()) {
110
-           return response()->json(['status' => 'error', 'errors' => $validator->errors()]);
110
+            return response()->json(['status' => 'error', 'errors' => $validator->errors()]);
111 111
         }
112 112
         
113 113
         if (!$id) {
114
-           return response()->json(['status' => 'error', 'message' => 'Conteúdo não informada']);
114
+            return response()->json(['status' => 'error', 'message' => 'Conteúdo não informada']);
115 115
         }
116 116
 
117 117
         $user = $this->model->where('id', $request->user()->id)->first();
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     public function destroy(Request $request, $id)
135 135
     {
136 136
         if (!$id) {
137
-           return response()->json(['status' => 'error', 'message' => 'Conteúdo não informada']);
137
+            return response()->json(['status' => 'error', 'message' => 'Conteúdo não informada']);
138 138
         }
139 139
 
140 140
         $user = $this->model->where('id', $request->user()->id)->first();
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     public function like(Request $request, $id)
158 158
     {
159 159
         if (!$id) {
160
-           return response()->json(['status' => 'error', 'message' => 'Conteúdo não informada']);
160
+            return response()->json(['status' => 'error', 'message' => 'Conteúdo não informada']);
161 161
         }
162 162
 
163 163
         $user = $this->model->where('id', $request->user()->id)->first();
@@ -175,17 +175,17 @@  discard block
 block discarded – undo
175 175
         $user->likes()->toggle($content->id);
176 176
 
177 177
         return response()->json([
178
-          'status' => 'success', 
179
-          'message' => 'Conteúdo curtido com sucesso.', 
180
-          'data' => $content->likes()->count(),
181
-          'listContent' => $this->index($request)
178
+            'status' => 'success', 
179
+            'message' => 'Conteúdo curtido com sucesso.', 
180
+            'data' => $content->likes()->count(),
181
+            'listContent' => $this->index($request)
182 182
         ]);
183 183
     }
184 184
   
185 185
     public function likePage(Request $request, $id)
186 186
     {
187 187
         if (!$id) {
188
-           return response()->json(['status' => 'error', 'message' => 'Conteúdo não informada']);
188
+            return response()->json(['status' => 'error', 'message' => 'Conteúdo não informada']);
189 189
         }
190 190
 
191 191
         $user = $this->model->where('id', $request->user()->id)->first();
@@ -203,10 +203,10 @@  discard block
 block discarded – undo
203 203
         $user->likes()->toggle($content->id);
204 204
 
205 205
         return response()->json([
206
-          'status' => 'success', 
207
-          'message' => 'Conteúdo curtido com sucesso.', 
208
-          'data' => $content->likes()->count(),
209
-          'listContent' => $this->page($request, $content->user_id)
206
+            'status' => 'success', 
207
+            'message' => 'Conteúdo curtido com sucesso.', 
208
+            'data' => $content->likes()->count(),
209
+            'listContent' => $this->page($request, $content->user_id)
210 210
         ]);
211 211
     }
212 212
   
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
         $validator = \Validator::make($request->all(), $rules);
220 220
 
221 221
         if ($validator->fails()) {
222
-           return response()->json(['status' => 'error', 'errors' => $validator->errors()]);
222
+            return response()->json(['status' => 'error', 'errors' => $validator->errors()]);
223 223
         }
224 224
 
225 225
         $user = $this->model->where('id', $request->user()->id)->first();
@@ -241,9 +241,9 @@  discard block
 block discarded – undo
241 241
         $user->comments()->create($data);
242 242
       
243 243
         return response()->json([
244
-          'status' => 'success', 
245
-          'message' => 'Comentário criado com sucesso.', 
246
-          'listContent' => $this->index($request)
244
+            'status' => 'success', 
245
+            'message' => 'Comentário criado com sucesso.', 
246
+            'listContent' => $this->index($request)
247 247
         ]);
248 248
     }
249 249
   
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
         $validator = \Validator::make($request->all(), $rules);
257 257
 
258 258
         if ($validator->fails()) {
259
-           return response()->json(['status' => 'error', 'errors' => $validator->errors()]);
259
+            return response()->json(['status' => 'error', 'errors' => $validator->errors()]);
260 260
         }
261 261
 
262 262
         $user = $this->model->where('id', $request->user()->id)->first();
@@ -278,9 +278,9 @@  discard block
 block discarded – undo
278 278
         $user->comments()->create($data);
279 279
       
280 280
         return response()->json([
281
-          'status' => 'success', 
282
-          'message' => 'Comentário criado com sucesso.', 
283
-          'listContent' => $this->page($request, $content->user_id)
281
+            'status' => 'success', 
282
+            'message' => 'Comentário criado com sucesso.', 
283
+            'listContent' => $this->page($request, $content->user_id)
284 284
         ]);
285 285
     }
286 286
   
@@ -289,21 +289,21 @@  discard block
 block discarded – undo
289 289
         $user = $this->model->where('id', $request->user()->id)->first();
290 290
 
291 291
         if (!$user) {
292
-          return response()->json(['status' => 'error', 'message' => 'Opss. Usuário não foi encontrado, favor verifique se esta logado.']);
292
+            return response()->json(['status' => 'error', 'message' => 'Opss. Usuário não foi encontrado, favor verifique se esta logado.']);
293 293
         }
294 294
       
295 295
         $userOwner = $this->model->where('id', $id)->first();
296 296
 
297 297
         if (!$userOwner) {
298
-          return response()->json(['status' => 'error', 'message' => 'Opss. Usuário não foi encontrado, favor verifique.']);
298
+            return response()->json(['status' => 'error', 'message' => 'Opss. Usuário não foi encontrado, favor verifique.']);
299 299
         }
300 300
       
301 301
         $contents = $userOwner->contents()->with('user')->orderBy('published_at','DESC')->paginate(2);
302 302
       
303 303
         foreach($contents as $key => $content) {
304
-          $content->total_likes = $content->likes()->count();
305
-          $content->comments = $content->comments()->with('user')->orderBy('created_at', 'DESC')->get();
306
-          $content->user_like_content = $user->likes()->find($content->id) ? true : false;
304
+            $content->total_likes = $content->likes()->count();
305
+            $content->comments = $content->comments()->with('user')->orderBy('created_at', 'DESC')->get();
306
+            $content->user_like_content = $user->likes()->find($content->id) ? true : false;
307 307
         }
308 308
 
309 309
         return response()->json(['status' => 'success', 'data' => $contents, 'user' => $userOwner]);
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
         $validator = \Validator::make($request->all(), $rules);
319 319
 
320 320
         if ($validator->fails()) {
321
-           return response()->json(['status' => 'error', 'errors' => $validator->errors()]);
321
+            return response()->json(['status' => 'error', 'errors' => $validator->errors()]);
322 322
         }
323 323
       
324 324
         $user = $this->model->where('id', $request->user()->id)->first();
@@ -340,10 +340,10 @@  discard block
 block discarded – undo
340 340
         $user->friends()->toggle($friend->id);
341 341
 
342 342
         return response()->json([
343
-          'status' => 'success', 
344
-          'message' => 'Segguindo '.$friend->name.' com sucesso.', 
345
-          'data' => $user->friends,
346
-          'followers' => $friend->followers
343
+            'status' => 'success', 
344
+            'message' => 'Segguindo '.$friend->name.' com sucesso.', 
345
+            'data' => $user->friends,
346
+            'followers' => $friend->followers
347 347
         ]);
348 348
     }
349 349
   
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
         $user = $this->model->where('id', $request->user()->id)->first();
353 353
 
354 354
         if (!$user) {
355
-          return response()->json(['status' => 'error', 'message' => 'Opss. Usuário não foi encontrado, favor verifique se esta logado.']);
355
+            return response()->json(['status' => 'error', 'message' => 'Opss. Usuário não foi encontrado, favor verifique se esta logado.']);
356 356
         }
357 357
       
358 358
         $friends = $user->friends;
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
         $user = $this->model->where('id', $request->user()->id)->first();
367 367
 
368 368
         if (!$user) {
369
-          return response()->json(['status' => 'error', 'message' => 'Opss. Usuário não foi encontrado, favor verifique se esta logado.']);
369
+            return response()->json(['status' => 'error', 'message' => 'Opss. Usuário não foi encontrado, favor verifique se esta logado.']);
370 370
         }
371 371
       
372 372
         $my_friends = $user->friends;
Please login to merge, or discard this patch.
app/Http/Controllers/Api/v1/ReportController.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
9 9
 
10 10
 class ReportController extends Controller
11 11
 {
12
-	private $model;
12
+    private $model;
13 13
 
14
-	/**
14
+    /**
15 15
      * Create a new controller instance.
16 16
      *
17 17
      * @return void
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         $validator = \Validator::make($request->all(), $rules);
32 32
 
33 33
         if ($validator->fails()) {
34
-           return response()->json(['status' => 'error', 'errors' => $validator->errors()]);
34
+            return response()->json(['status' => 'error', 'errors' => $validator->errors()]);
35 35
         }
36 36
 
37 37
         $user = $this->model->where('id', $request->user()->id)->first();
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         $validator = \Validator::make($request->all(), $rules);
88 88
 
89 89
         if ($validator->fails()) {
90
-           return response()->json(['status' => 'error', 'errors' => $validator->errors()]);
90
+            return response()->json(['status' => 'error', 'errors' => $validator->errors()]);
91 91
         }
92 92
 
93 93
         $user = $this->model->where('id', $request->user()->id)->first();
Please login to merge, or discard this patch.
app/Http/Controllers/Api/v1/Auth/RegisterController.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -11,40 +11,40 @@
 block discarded – undo
11 11
 
12 12
 class RegisterController extends Controller
13 13
 {
14
-	public function register(Request $request)
15
-	{
16
-		$rules = [
17
-        	'name' => 'required',
18
-    		'email' => 'required|email|unique:users,email',
19
-    		'password' => 'required|string|min:6|confirmed',
20
-    	];
14
+    public function register(Request $request)
15
+    {
16
+        $rules = [
17
+            'name' => 'required',
18
+            'email' => 'required|email|unique:users,email',
19
+            'password' => 'required|string|min:6|confirmed',
20
+        ];
21 21
 
22
-    	$validator = \Validator::make($request->all(), $rules);
22
+        $validator = \Validator::make($request->all(), $rules);
23 23
 
24
-	    if ($validator->fails()) {
25
-	       return response()->json(['status' => 'error', 'errors' => $validator->errors()], 422);
26
-	    }
24
+        if ($validator->fails()) {
25
+            return response()->json(['status' => 'error', 'errors' => $validator->errors()], 422);
26
+        }
27 27
 
28
-		$data = $request->all();
28
+        $data = $request->all();
29 29
 
30
-		$token = str_random(50);
30
+        $token = str_random(50);
31 31
 		
32
-		$user = new User;
33
-		$user->name = $data['name'];
34
-		$user->email = $data['email'];
35
-		$user->password = bcrypt($data['password']);
36
-    	$user->image = '/profiles/default.png';
37
-    	$user->token = $token;
38
-		$user->save();
32
+        $user = new User;
33
+        $user->name = $data['name'];
34
+        $user->email = $data['email'];
35
+        $user->password = bcrypt($data['password']);
36
+        $user->image = '/profiles/default.png';
37
+        $user->token = $token;
38
+        $user->save();
39 39
 
40
-		$url = config('app.url_frontend_react') . "/confirmation/{$token}";
40
+        $url = config('app.url_frontend_react') . "/confirmation/{$token}";
41 41
 
42
-		$user->notify(new RegisterNotification($user, $token, $url));
42
+        $user->notify(new RegisterNotification($user, $token, $url));
43 43
 
44
-		return response()->json(['status' => 'success', 'message' => 'Conta criada com sucesso, verifique seu e-mail para ativar seu cadastro.']);
45
-	}
44
+        return response()->json(['status' => 'success', 'message' => 'Conta criada com sucesso, verifique seu e-mail para ativar seu cadastro.']);
45
+    }
46 46
 
47
-	public function confirmation($token)
47
+    public function confirmation($token)
48 48
     {
49 49
         $user = User::where('token', $token)->first();
50 50
 
Please login to merge, or discard this patch.
app/Http/Controllers/Api/v1/Auth/LoginController.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,12 +9,12 @@
 block discarded – undo
9 9
 
10 10
 class LoginController extends Controller
11 11
 {
12
-	public function logout()
13
-	{
14
-		if (\Auth::check()) {
15
-			\Auth::user()->oauthAccessToken()->delete();
16
-		}
12
+    public function logout()
13
+    {
14
+        if (\Auth::check()) {
15
+            \Auth::user()->oauthAccessToken()->delete();
16
+        }
17 17
 
18
-		return response()->json(['status' => 'success', 'message' => 'Logout realizado com sucesso']);
19
-	}
18
+        return response()->json(['status' => 'success', 'message' => 'Logout realizado com sucesso']);
19
+    }
20 20
 }
Please login to merge, or discard this patch.