Completed
Push — master ( a2ea8b...2c4876 )
by Sherif
02:24
created
src/Modules/V1/Core/Http/Controllers/BaseApiController.php 3 patches
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -173,8 +173,7 @@  discard block
 block discarded – undo
173 173
             if ($request->has('id')) 
174 174
             {
175 175
                 $rule = str_replace('{id}', $request->get('id'), $rule);
176
-            }
177
-            else
176
+            } else
178 177
             {
179 178
                 $rule = str_replace(',{id}', '', $rule);
180 179
             }
@@ -252,10 +251,8 @@  discard block
 block discarded – undo
252 251
             }
253 252
 
254 253
             if ($isPasswordClient && (in_array($permission, $this->skipPermissionCheck) || \Core::users()->can($permission, $this->model)))
255
-            {}
256
-            elseif ( ! $isPasswordClient && $user->tokenCan($this->model . '-' . $permission)) 
257
-            {}
258
-            else
254
+            {} elseif ( ! $isPasswordClient && $user->tokenCan($this->model . '-' . $permission)) 
255
+            {} else
259 256
             {
260 257
 
261 258
                 \ErrorHandler::noPermissions();
Please login to merge, or discard this patch.
Indentation   +247 added lines, -247 removed lines patch added patch discarded remove patch
@@ -6,282 +6,282 @@
 block discarded – undo
6 6
 
7 7
 class BaseApiController extends Controller
8 8
 {
9
-    /**
10
-     * The config implementation.
11
-     * 
12
-     * @var array
13
-     */
14
-    protected $config;
9
+	/**
10
+	 * The config implementation.
11
+	 * 
12
+	 * @var array
13
+	 */
14
+	protected $config;
15 15
 
16
-    /**
17
-     * The relations implementation.
18
-     * 
19
-     * @var array
20
-     */
21
-    protected $relations;
16
+	/**
17
+	 * The relations implementation.
18
+	 * 
19
+	 * @var array
20
+	 */
21
+	protected $relations;
22 22
 
23
-    /**
24
-     * The repo implementation.
25
-     * 
26
-     * @var object
27
-     */
28
-    protected $repo;
23
+	/**
24
+	 * The repo implementation.
25
+	 * 
26
+	 * @var object
27
+	 */
28
+	protected $repo;
29 29
 
30
-    public function __construct()
31
-    {        
32
-        $this->config              = \CoreConfig::getConfig();
33
-        $this->model               = property_exists($this, 'model') ? $this->model : false;
34
-        $this->validationRules     = property_exists($this, 'validationRules') ? $this->validationRules : false;
35
-        $this->skipPermissionCheck = property_exists($this, 'skipPermissionCheck') ? $this->skipPermissionCheck : [];
36
-        $this->skipLoginCheck      = property_exists($this, 'skipLoginCheck') ? $this->skipLoginCheck : [];
37
-        $route                     = explode('@',\Route::currentRouteAction())[1];
30
+	public function __construct()
31
+	{        
32
+		$this->config              = \CoreConfig::getConfig();
33
+		$this->model               = property_exists($this, 'model') ? $this->model : false;
34
+		$this->validationRules     = property_exists($this, 'validationRules') ? $this->validationRules : false;
35
+		$this->skipPermissionCheck = property_exists($this, 'skipPermissionCheck') ? $this->skipPermissionCheck : [];
36
+		$this->skipLoginCheck      = property_exists($this, 'skipLoginCheck') ? $this->skipLoginCheck : [];
37
+		$route                     = explode('@',\Route::currentRouteAction())[1];
38 38
 
39
-        $this->middleware(function ($request, $next) {
39
+		$this->middleware(function ($request, $next) {
40 40
             
41
-            $this->repo = call_user_func_array("\Core::{$this->model}", []);            
42
-            return $next($request);
43
-        });
41
+			$this->repo = call_user_func_array("\Core::{$this->model}", []);            
42
+			return $next($request);
43
+		});
44 44
 
45
-        $this->checkPermission($route);
46
-        $this->setRelations($route);
47
-        $this->setSessions();
48
-    }
45
+		$this->checkPermission($route);
46
+		$this->setRelations($route);
47
+		$this->setSessions();
48
+	}
49 49
 
50
-    /**
51
-     * Fetch all records with relations from storage.
52
-     * 
53
-     * @param  string  $sortBy The name of the column to sort by.
54
-     * @param  boolean $desc   Sort ascending or descinding (1: desc, 0: asc).
55
-     * @return \Illuminate\Http\Response
56
-     */
57
-    public function index($sortBy = 'created_at', $desc = 1) 
58
-    {
59
-        return \Response::json($this->repo->all($this->relations, $sortBy, $desc), 200);
60
-    }
50
+	/**
51
+	 * Fetch all records with relations from storage.
52
+	 * 
53
+	 * @param  string  $sortBy The name of the column to sort by.
54
+	 * @param  boolean $desc   Sort ascending or descinding (1: desc, 0: asc).
55
+	 * @return \Illuminate\Http\Response
56
+	 */
57
+	public function index($sortBy = 'created_at', $desc = 1) 
58
+	{
59
+		return \Response::json($this->repo->all($this->relations, $sortBy, $desc), 200);
60
+	}
61 61
 
62
-    /**
63
-     * Fetch the single object with relations from storage.
64
-     * 
65
-     * @param  integer $id Id of the requested model.
66
-     * @return \Illuminate\Http\Response
67
-     */
68
-    public function find($id) 
69
-    {
70
-        return \Response::json($this->repo->find($id, $this->relations), 200);
71
-    }
62
+	/**
63
+	 * Fetch the single object with relations from storage.
64
+	 * 
65
+	 * @param  integer $id Id of the requested model.
66
+	 * @return \Illuminate\Http\Response
67
+	 */
68
+	public function find($id) 
69
+	{
70
+		return \Response::json($this->repo->find($id, $this->relations), 200);
71
+	}
72 72
 
73
-    /**
74
-     * Paginate all records with relations from storage
75
-     * that matche the given query.
76
-     * 
77
-     * @param  string  $query   The search text.
78
-     * @param  integer $perPage Number of rows per page default 15.
79
-     * @param  string  $sortBy  The name of the column to sort by.
80
-     * @param  boolean $desc    Sort ascending or descinding (1: desc, 0: asc).
81
-     * @return \Illuminate\Http\Response
82
-     */
83
-    public function search($query = '', $perPage = 15, $sortBy = 'created_at', $desc = 1) 
84
-    {
85
-        return \Response::json($this->repo->search($query, $perPage, $this->relations, $sortBy, $desc), 200);
86
-    }
73
+	/**
74
+	 * Paginate all records with relations from storage
75
+	 * that matche the given query.
76
+	 * 
77
+	 * @param  string  $query   The search text.
78
+	 * @param  integer $perPage Number of rows per page default 15.
79
+	 * @param  string  $sortBy  The name of the column to sort by.
80
+	 * @param  boolean $desc    Sort ascending or descinding (1: desc, 0: asc).
81
+	 * @return \Illuminate\Http\Response
82
+	 */
83
+	public function search($query = '', $perPage = 15, $sortBy = 'created_at', $desc = 1) 
84
+	{
85
+		return \Response::json($this->repo->search($query, $perPage, $this->relations, $sortBy, $desc), 200);
86
+	}
87 87
 
88
-    /**
89
-     * Fetch records from the storage based on the given
90
-     * condition.
91
-     * 
92
-     * @param  \Illuminate\Http\Request  $request
93
-     * @param  string  $sortBy The name of the column to sort by.
94
-     * @param  boolean $desc   Sort ascending or descinding (1: desc, 0: asc).
95
-     * @return \Illuminate\Http\Response
96
-     */
97
-    public function findby(Request $request, $sortBy = 'created_at', $desc = 1) 
98
-    {
99
-        return \Response::json($this->repo->findBy($request->all(), $this->relations, $sortBy, $desc), 200);
100
-    }
88
+	/**
89
+	 * Fetch records from the storage based on the given
90
+	 * condition.
91
+	 * 
92
+	 * @param  \Illuminate\Http\Request  $request
93
+	 * @param  string  $sortBy The name of the column to sort by.
94
+	 * @param  boolean $desc   Sort ascending or descinding (1: desc, 0: asc).
95
+	 * @return \Illuminate\Http\Response
96
+	 */
97
+	public function findby(Request $request, $sortBy = 'created_at', $desc = 1) 
98
+	{
99
+		return \Response::json($this->repo->findBy($request->all(), $this->relations, $sortBy, $desc), 200);
100
+	}
101 101
 
102
-    /**
103
-     * Fetch the first record from the storage based on the given
104
-     * condition.
105
-     * 
106
-     * @param  \Illuminate\Http\Request  $request
107
-     * @return \Illuminate\Http\Response
108
-     */
109
-    public function first(Request $request) 
110
-    {
111
-        return \Response::json($this->repo->first($request->all(), $this->relations), 200);
112
-    }
102
+	/**
103
+	 * Fetch the first record from the storage based on the given
104
+	 * condition.
105
+	 * 
106
+	 * @param  \Illuminate\Http\Request  $request
107
+	 * @return \Illuminate\Http\Response
108
+	 */
109
+	public function first(Request $request) 
110
+	{
111
+		return \Response::json($this->repo->first($request->all(), $this->relations), 200);
112
+	}
113 113
 
114
-    /**
115
-     * Paginate all records with relations from storage.
116
-     * 
117
-     * @param  integer $perPage Number of rows per page default 15.
118
-     * @param  string  $sortBy  The name of the column to sort by.
119
-     * @param  boolean $desc    Sort ascending or descinding (1: desc, 0: asc).
120
-     * @return \Illuminate\Http\Response
121
-     */
122
-    public function paginate($perPage = 15, $sortBy = 'created_at', $desc = 1) 
123
-    {
124
-        return \Response::json($this->repo->paginate($perPage, $this->relations, $sortBy, $desc), 200);
125
-    }
114
+	/**
115
+	 * Paginate all records with relations from storage.
116
+	 * 
117
+	 * @param  integer $perPage Number of rows per page default 15.
118
+	 * @param  string  $sortBy  The name of the column to sort by.
119
+	 * @param  boolean $desc    Sort ascending or descinding (1: desc, 0: asc).
120
+	 * @return \Illuminate\Http\Response
121
+	 */
122
+	public function paginate($perPage = 15, $sortBy = 'created_at', $desc = 1) 
123
+	{
124
+		return \Response::json($this->repo->paginate($perPage, $this->relations, $sortBy, $desc), 200);
125
+	}
126 126
 
127
-    /**
128
-     * Fetch all records with relations based on
129
-     * the given condition from storage in pages.
130
-     * 
131
-     * @param  \Illuminate\Http\Request  $request
132
-     * @param  integer $perPage Number of rows per page default 15.
133
-     * @param  string  $sortBy  The name of the column to sort by.
134
-     * @param  boolean $desc    Sort ascending or descinding (1: desc, 0: asc).
135
-     * @return \Illuminate\Http\Response
136
-     */
137
-    public function paginateby(Request $request, $perPage = 15, $sortBy = 'created_at', $desc = 1) 
138
-    {
139
-        return \Response::json($this->repo->paginateBy($request->all(), $perPage, $this->relations, $sortBy, $desc), 200);
140
-    }
127
+	/**
128
+	 * Fetch all records with relations based on
129
+	 * the given condition from storage in pages.
130
+	 * 
131
+	 * @param  \Illuminate\Http\Request  $request
132
+	 * @param  integer $perPage Number of rows per page default 15.
133
+	 * @param  string  $sortBy  The name of the column to sort by.
134
+	 * @param  boolean $desc    Sort ascending or descinding (1: desc, 0: asc).
135
+	 * @return \Illuminate\Http\Response
136
+	 */
137
+	public function paginateby(Request $request, $perPage = 15, $sortBy = 'created_at', $desc = 1) 
138
+	{
139
+		return \Response::json($this->repo->paginateBy($request->all(), $perPage, $this->relations, $sortBy, $desc), 200);
140
+	}
141 141
 
142
-    /**
143
-     * Save the given model to storage.
144
-     * 
145
-     * @param  \Illuminate\Http\Request  $request
146
-     * @return \Illuminate\Http\Response
147
-     */
148
-    public function save(Request $request) 
149
-    {
150
-        foreach ($this->validationRules as &$rule) 
151
-        {
152
-            if (strpos($rule, 'exists') && ! strpos($rule, 'deleted_at,NULL')) 
153
-            {
154
-                $rule .= ',deleted_at,NULL';
155
-            }
142
+	/**
143
+	 * Save the given model to storage.
144
+	 * 
145
+	 * @param  \Illuminate\Http\Request  $request
146
+	 * @return \Illuminate\Http\Response
147
+	 */
148
+	public function save(Request $request) 
149
+	{
150
+		foreach ($this->validationRules as &$rule) 
151
+		{
152
+			if (strpos($rule, 'exists') && ! strpos($rule, 'deleted_at,NULL')) 
153
+			{
154
+				$rule .= ',deleted_at,NULL';
155
+			}
156 156
 
157
-            if ($request->has('id')) 
158
-            {
159
-                $rule = str_replace('{id}', $request->get('id'), $rule);
160
-            }
161
-            else
162
-            {
163
-                $rule = str_replace(',{id}', '', $rule);
164
-            }
165
-        }
157
+			if ($request->has('id')) 
158
+			{
159
+				$rule = str_replace('{id}', $request->get('id'), $rule);
160
+			}
161
+			else
162
+			{
163
+				$rule = str_replace(',{id}', '', $rule);
164
+			}
165
+		}
166 166
         
167
-        $this->validate($request, $this->validationRules);
167
+		$this->validate($request, $this->validationRules);
168 168
 
169
-        return \Response::json($this->repo->save($request->all()), 200);
170
-    }
169
+		return \Response::json($this->repo->save($request->all()), 200);
170
+	}
171 171
 
172
-    /**
173
-     * Delete by the given id from storage.
174
-     * 
175
-     * @param  integer $id Id of the deleted model.
176
-     * @return \Illuminate\Http\Response
177
-     */
178
-    public function delete($id) 
179
-    {
180
-        return \Response::json($this->repo->delete($id), 200);
181
-    }
172
+	/**
173
+	 * Delete by the given id from storage.
174
+	 * 
175
+	 * @param  integer $id Id of the deleted model.
176
+	 * @return \Illuminate\Http\Response
177
+	 */
178
+	public function delete($id) 
179
+	{
180
+		return \Response::json($this->repo->delete($id), 200);
181
+	}
182 182
 
183
-    /**
184
-     * Return the deleted models in pages based on the given conditions.
185
-     *
186
-     * @param  \Illuminate\Http\Request  $request
187
-     * @param  integer $perPage Number of rows per page default 15.
188
-     * @param  string  $sortBy  The name of the column to sort by.
189
-     * @param  boolean $desc    Sort ascending or descinding (1: desc, 0: asc).
190
-     * @return \Illuminate\Http\Response
191
-     */
192
-    public function deleted(Request $request, $perPage = 15, $sortBy = 'created_at', $desc = 1) 
193
-    {
194
-        return \Response::json($this->repo->deleted($request->all(), $perPage, $sortBy, $desc), 200);
195
-    }
183
+	/**
184
+	 * Return the deleted models in pages based on the given conditions.
185
+	 *
186
+	 * @param  \Illuminate\Http\Request  $request
187
+	 * @param  integer $perPage Number of rows per page default 15.
188
+	 * @param  string  $sortBy  The name of the column to sort by.
189
+	 * @param  boolean $desc    Sort ascending or descinding (1: desc, 0: asc).
190
+	 * @return \Illuminate\Http\Response
191
+	 */
192
+	public function deleted(Request $request, $perPage = 15, $sortBy = 'created_at', $desc = 1) 
193
+	{
194
+		return \Response::json($this->repo->deleted($request->all(), $perPage, $sortBy, $desc), 200);
195
+	}
196 196
 
197
-    /**
198
-     * Restore the deleted model.
199
-     * 
200
-     * @param  integer $id Id of the restored model.
201
-     * @return \Illuminate\Http\Response
202
-     */
203
-    public function restore($id) 
204
-    {
205
-        return \Response::json($this->repo->restore($id), 200);
206
-    }
197
+	/**
198
+	 * Restore the deleted model.
199
+	 * 
200
+	 * @param  integer $id Id of the restored model.
201
+	 * @return \Illuminate\Http\Response
202
+	 */
203
+	public function restore($id) 
204
+	{
205
+		return \Response::json($this->repo->restore($id), 200);
206
+	}
207 207
 
208
-    /**
209
-     * Check if the logged in user can do the given permission.
210
-     * 
211
-     * @param  string $permission
212
-     * @return void
213
-     */
214
-    private function checkPermission($permission)
215
-    {   
216
-        \Auth::shouldUse('api');
217
-        $this->middleware('auth:api', ['except' => $this->skipLoginCheck]);
208
+	/**
209
+	 * Check if the logged in user can do the given permission.
210
+	 * 
211
+	 * @param  string $permission
212
+	 * @return void
213
+	 */
214
+	private function checkPermission($permission)
215
+	{   
216
+		\Auth::shouldUse('api');
217
+		$this->middleware('auth:api', ['except' => $this->skipLoginCheck]);
218 218
         
219
-        if ($user = \Auth::user()) 
220
-        {
221
-            $permission       = $permission !== 'index' ? $permission : 'list';
222
-            $isPasswordClient = $user->token()->client->password_client;
219
+		if ($user = \Auth::user()) 
220
+		{
221
+			$permission       = $permission !== 'index' ? $permission : 'list';
222
+			$isPasswordClient = $user->token()->client->password_client;
223 223
 
224
-            if ($user->blocked)
225
-            {
226
-                \ErrorHandler::userIsBlocked();
227
-            }
224
+			if ($user->blocked)
225
+			{
226
+				\ErrorHandler::userIsBlocked();
227
+			}
228 228
 
229
-            if ($isPasswordClient && (in_array($permission, $this->skipPermissionCheck) || \Core::users()->can($permission, $this->model)))
230
-            {}
231
-            elseif ( ! $isPasswordClient && $user->tokenCan($this->model . '-' . $permission)) 
232
-            {}
233
-            else
234
-            {
229
+			if ($isPasswordClient && (in_array($permission, $this->skipPermissionCheck) || \Core::users()->can($permission, $this->model)))
230
+			{}
231
+			elseif ( ! $isPasswordClient && $user->tokenCan($this->model . '-' . $permission)) 
232
+			{}
233
+			else
234
+			{
235 235
 
236
-                \ErrorHandler::noPermissions();
237
-            }
238
-        }
239
-    }
236
+				\ErrorHandler::noPermissions();
237
+			}
238
+		}
239
+	}
240 240
 
241
-    /**
242
-     * Set sessions based on the given headers in the request.
243
-     * 
244
-     * @return void
245
-     */
246
-    private function setSessions()
247
-    {
248
-        \Session::put('timeZoneDiff', \Request::header('time-zone-diff') ?: 0);
241
+	/**
242
+	 * Set sessions based on the given headers in the request.
243
+	 * 
244
+	 * @return void
245
+	 */
246
+	private function setSessions()
247
+	{
248
+		\Session::put('timeZoneDiff', \Request::header('time-zone-diff') ?: 0);
249 249
 
250
-        $locale = \Request::header('locale');
251
-        switch ($locale) 
252
-        {
253
-            case 'en':
254
-            \App::setLocale('en');
255
-            \Session::put('locale', 'en');
256
-            break;
250
+		$locale = \Request::header('locale');
251
+		switch ($locale) 
252
+		{
253
+			case 'en':
254
+			\App::setLocale('en');
255
+			\Session::put('locale', 'en');
256
+			break;
257 257
 
258
-            case 'ar':
259
-            \App::setLocale('ar');
260
-            \Session::put('locale', 'ar');
261
-            break;
258
+			case 'ar':
259
+			\App::setLocale('ar');
260
+			\Session::put('locale', 'ar');
261
+			break;
262 262
 
263
-            case 'all':
264
-            \App::setLocale('en');
265
-            \Session::put('locale', 'all');
266
-            break;
263
+			case 'all':
264
+			\App::setLocale('en');
265
+			\Session::put('locale', 'all');
266
+			break;
267 267
 
268
-            default:
269
-            \App::setLocale('en');
270
-            \Session::put('locale', 'en');
271
-            break;
272
-        }
273
-    }
268
+			default:
269
+			\App::setLocale('en');
270
+			\Session::put('locale', 'en');
271
+			break;
272
+		}
273
+	}
274 274
 
275
-    /**
276
-     * Set relation based on the called api.
277
-     * 
278
-     * @param  string $route
279
-     * @return void
280
-     */
281
-    private function setRelations($route)
282
-    {
283
-        $route           = $route !== 'index' ? $route : 'list';
284
-        $relations       = array_key_exists($this->model, $this->config['relations']) ? $this->config['relations'][$this->model] : false;
285
-        $this->relations = $relations && isset($relations[$route]) ? $relations[$route] : [];
286
-    }
275
+	/**
276
+	 * Set relation based on the called api.
277
+	 * 
278
+	 * @param  string $route
279
+	 * @return void
280
+	 */
281
+	private function setRelations($route)
282
+	{
283
+		$route           = $route !== 'index' ? $route : 'list';
284
+		$relations       = array_key_exists($this->model, $this->config['relations']) ? $this->config['relations'][$this->model] : false;
285
+		$this->relations = $relations && isset($relations[$route]) ? $relations[$route] : [];
286
+	}
287 287
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
         $this->validationRules     = property_exists($this, 'validationRules') ? $this->validationRules : false;
35 35
         $this->skipPermissionCheck = property_exists($this, 'skipPermissionCheck') ? $this->skipPermissionCheck : [];
36 36
         $this->skipLoginCheck      = property_exists($this, 'skipLoginCheck') ? $this->skipLoginCheck : [];
37
-        $route                     = explode('@',\Route::currentRouteAction())[1];
37
+        $route                     = explode('@', \Route::currentRouteAction())[1];
38 38
 
39
-        $this->middleware(function ($request, $next) {
39
+        $this->middleware(function($request, $next) {
40 40
             
41 41
             $this->repo = call_user_func_array("\Core::{$this->model}", []);            
42 42
             return $next($request);
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 
229 229
             if ($isPasswordClient && (in_array($permission, $this->skipPermissionCheck) || \Core::users()->can($permission, $this->model)))
230 230
             {}
231
-            elseif ( ! $isPasswordClient && $user->tokenCan($this->model . '-' . $permission)) 
231
+            elseif ( ! $isPasswordClient && $user->tokenCan($this->model.'-'.$permission)) 
232 232
             {}
233 233
             else
234 234
             {
Please login to merge, or discard this patch.
src/Modules/V1/Acl/Database/Seeds/OauthClientsTableSeeder.php 1 patch
Indentation   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -6,82 +6,82 @@
 block discarded – undo
6 6
 
7 7
 class OauthClientsTableSeeder extends Seeder
8 8
 {
9
-    /**
10
-     * Run the database seeds.
11
-     *
12
-     * @return void
13
-     */
14
-    public function run()
15
-    {
16
-    	/**
17
-         * Insert the permissions related to oauthClients table.
18
-         */
19
-        \DB::table('permissions')->insert(
20
-        	[
21
-        		/**
22
-        		 * Users model permissions.
23
-        		 */
24
-	        	[
25
-	        	'name'       => 'list',
26
-	        	'model'      => 'oauthClients',
27
-	        	'created_at' => \DB::raw('NOW()'),
28
-	        	'updated_at' => \DB::raw('NOW()')
29
-	        	],
30
-	        	[
31
-	        	'name'       => 'find',
32
-	        	'model'      => 'oauthClients',
33
-	        	'created_at' => \DB::raw('NOW()'),
34
-	        	'updated_at' => \DB::raw('NOW()')
35
-	        	],
36
-	        	[
37
-	        	'name'       => 'search',
38
-	        	'model'      => 'oauthClients',
39
-	        	'created_at' => \DB::raw('NOW()'),
40
-	        	'updated_at' => \DB::raw('NOW()')
41
-	        	],
42
-	        	[
43
-	        	'name'       => 'paginate',
44
-	        	'model'      => 'oauthClients',
45
-	        	'created_at' => \DB::raw('NOW()'),
46
-	        	'updated_at' => \DB::raw('NOW()')
47
-	        	],
48
-	        	[
49
-	        	'name'       => 'revoke',
50
-	        	'model'      => 'oauthClients',
51
-	        	'created_at' => \DB::raw('NOW()'),
52
-	        	'updated_at' => \DB::raw('NOW()')
53
-	        	],
54
-	        	[
55
-	        	'name'       => 'unRevoke',
56
-	        	'model'      => 'oauthClients',
57
-	        	'created_at' => \DB::raw('NOW()'),
58
-	        	'updated_at' => \DB::raw('NOW()')
59
-	        	],
60
-	        	[
61
-	        	'name'       => 'first',
62
-	        	'model'      => 'oauthClients',
63
-	        	'created_at' => \DB::raw('NOW()'),
64
-	        	'updated_at' => \DB::raw('NOW()')
65
-	        	],
66
-	        	[
67
-	        	'name'       => 'findby',
68
-	        	'model'      => 'oauthClients',
69
-	        	'created_at' => \DB::raw('NOW()'),
70
-	        	'updated_at' => \DB::raw('NOW()')
71
-	        	],
72
-	        	[
73
-	        	'name'       => 'paginateby',
74
-	        	'model'      => 'oauthClients',
75
-	        	'created_at' => \DB::raw('NOW()'),
76
-	        	'updated_at' => \DB::raw('NOW()')
77
-	        	],
78
-	        	[
79
-	        	'name'       => 'save',
80
-	        	'model'      => 'oauthClients',
81
-	        	'created_at' => \DB::raw('NOW()'),
82
-	        	'updated_at' => \DB::raw('NOW()')
83
-	        	]
84
-        	]
85
-        );
86
-    }
9
+	/**
10
+	 * Run the database seeds.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function run()
15
+	{
16
+		/**
17
+		 * Insert the permissions related to oauthClients table.
18
+		 */
19
+		\DB::table('permissions')->insert(
20
+			[
21
+				/**
22
+				 * Users model permissions.
23
+				 */
24
+				[
25
+				'name'       => 'list',
26
+				'model'      => 'oauthClients',
27
+				'created_at' => \DB::raw('NOW()'),
28
+				'updated_at' => \DB::raw('NOW()')
29
+				],
30
+				[
31
+				'name'       => 'find',
32
+				'model'      => 'oauthClients',
33
+				'created_at' => \DB::raw('NOW()'),
34
+				'updated_at' => \DB::raw('NOW()')
35
+				],
36
+				[
37
+				'name'       => 'search',
38
+				'model'      => 'oauthClients',
39
+				'created_at' => \DB::raw('NOW()'),
40
+				'updated_at' => \DB::raw('NOW()')
41
+				],
42
+				[
43
+				'name'       => 'paginate',
44
+				'model'      => 'oauthClients',
45
+				'created_at' => \DB::raw('NOW()'),
46
+				'updated_at' => \DB::raw('NOW()')
47
+				],
48
+				[
49
+				'name'       => 'revoke',
50
+				'model'      => 'oauthClients',
51
+				'created_at' => \DB::raw('NOW()'),
52
+				'updated_at' => \DB::raw('NOW()')
53
+				],
54
+				[
55
+				'name'       => 'unRevoke',
56
+				'model'      => 'oauthClients',
57
+				'created_at' => \DB::raw('NOW()'),
58
+				'updated_at' => \DB::raw('NOW()')
59
+				],
60
+				[
61
+				'name'       => 'first',
62
+				'model'      => 'oauthClients',
63
+				'created_at' => \DB::raw('NOW()'),
64
+				'updated_at' => \DB::raw('NOW()')
65
+				],
66
+				[
67
+				'name'       => 'findby',
68
+				'model'      => 'oauthClients',
69
+				'created_at' => \DB::raw('NOW()'),
70
+				'updated_at' => \DB::raw('NOW()')
71
+				],
72
+				[
73
+				'name'       => 'paginateby',
74
+				'model'      => 'oauthClients',
75
+				'created_at' => \DB::raw('NOW()'),
76
+				'updated_at' => \DB::raw('NOW()')
77
+				],
78
+				[
79
+				'name'       => 'save',
80
+				'model'      => 'oauthClients',
81
+				'created_at' => \DB::raw('NOW()'),
82
+				'updated_at' => \DB::raw('NOW()')
83
+				]
84
+			]
85
+		);
86
+	}
87 87
 }
Please login to merge, or discard this patch.
src/Modules/V1/Acl/Repositories/OauthClientRepository.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -4,37 +4,37 @@
 block discarded – undo
4 4
 
5 5
 class OauthClientRepository extends AbstractRepository
6 6
 {
7
-    /**
8
-     * Return the model full namespace.
9
-     * 
10
-     * @return string
11
-     */
12
-    protected function getModel()
13
-    {
14
-        return 'App\Modules\V1\Acl\OauthClient';
15
-    }
7
+	/**
8
+	 * Return the model full namespace.
9
+	 * 
10
+	 * @return string
11
+	 */
12
+	protected function getModel()
13
+	{
14
+		return 'App\Modules\V1\Acl\OauthClient';
15
+	}
16 16
 
17
-    /**
18
-     * Revoke the given client.
19
-     *
20
-     * @param  integer  $clientId
21
-     * @return void
22
-     */
23
-    public function revoke($clientId)
24
-    {
25
-        $client = $this->find($clientId);
26
-        $client->tokens()->update(['revoked' => true]);
27
-        $this->save(['id'=> $clientId, 'revoked' => true]);
28
-    }
17
+	/**
18
+	 * Revoke the given client.
19
+	 *
20
+	 * @param  integer  $clientId
21
+	 * @return void
22
+	 */
23
+	public function revoke($clientId)
24
+	{
25
+		$client = $this->find($clientId);
26
+		$client->tokens()->update(['revoked' => true]);
27
+		$this->save(['id'=> $clientId, 'revoked' => true]);
28
+	}
29 29
 
30
-    /**
31
-     * Un revoke the given client.
32
-     *
33
-     * @param  integer  $clientId
34
-     * @return void
35
-     */
36
-    public function unRevoke($clientId)
37
-    {
38
-        $this->save(['id'=> $clientId, 'revoked' => false]);
39
-    }
30
+	/**
31
+	 * Un revoke the given client.
32
+	 *
33
+	 * @param  integer  $clientId
34
+	 * @return void
35
+	 */
36
+	public function unRevoke($clientId)
37
+	{
38
+		$this->save(['id'=> $clientId, 'revoked' => false]);
39
+	}
40 40
 }
Please login to merge, or discard this patch.
src/Modules/V1/Acl/Http/Controllers/OauthClientsController.php 2 patches
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -8,44 +8,44 @@
 block discarded – undo
8 8
 
9 9
 class OauthClientsController extends BaseApiController
10 10
 {
11
-    /**
12
-     * The name of the model that is used by the base api controller 
13
-     * to preform actions like (add, edit ... etc).
14
-     * @var string
15
-     */
16
-    protected $model               = 'oauthClients';
11
+	/**
12
+	 * The name of the model that is used by the base api controller 
13
+	 * to preform actions like (add, edit ... etc).
14
+	 * @var string
15
+	 */
16
+	protected $model               = 'oauthClients';
17 17
 
18
-    /**
19
-     * The validations rules used by the base api controller
20
-     * to check before add.
21
-     * @var array
22
-     */
23
-    protected $validationRules  = [
24
-        'name'     => 'required|max:255',
25
-        'redirect' => 'required|url',
26
-        'user_id'  => 'required|exists:users,id',
27
-        'revoked'  => 'boolean'
28
-    ];
18
+	/**
19
+	 * The validations rules used by the base api controller
20
+	 * to check before add.
21
+	 * @var array
22
+	 */
23
+	protected $validationRules  = [
24
+		'name'     => 'required|max:255',
25
+		'redirect' => 'required|url',
26
+		'user_id'  => 'required|exists:users,id',
27
+		'revoked'  => 'boolean'
28
+	];
29 29
 
30
-    /**
31
-     * Revoke the given client.
32
-     *
33
-     * @param  integer  $clientId Id of the client
34
-     * @return \Illuminate\Http\Response
35
-     */
36
-    public function revoke($clientId)
37
-    {
38
-        return \Response::json($this->repo->revoke($clientId), 200);
39
-    }
30
+	/**
31
+	 * Revoke the given client.
32
+	 *
33
+	 * @param  integer  $clientId Id of the client
34
+	 * @return \Illuminate\Http\Response
35
+	 */
36
+	public function revoke($clientId)
37
+	{
38
+		return \Response::json($this->repo->revoke($clientId), 200);
39
+	}
40 40
 
41
-    /**
42
-     * Un revoke the given client.
43
-     *
44
-     * @param  integer  $clientId Id of the client
45
-     * @return \Illuminate\Http\Response
46
-     */
47
-    public function unRevoke($clientId)
48
-    {
49
-        return \Response::json($this->repo->unRevoke($clientId), 200);
50
-    }
41
+	/**
42
+	 * Un revoke the given client.
43
+	 *
44
+	 * @param  integer  $clientId Id of the client
45
+	 * @return \Illuminate\Http\Response
46
+	 */
47
+	public function unRevoke($clientId)
48
+	{
49
+		return \Response::json($this->repo->unRevoke($clientId), 200);
50
+	}
51 51
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,14 +13,14 @@
 block discarded – undo
13 13
      * to preform actions like (add, edit ... etc).
14 14
      * @var string
15 15
      */
16
-    protected $model               = 'oauthClients';
16
+    protected $model = 'oauthClients';
17 17
 
18 18
     /**
19 19
      * The validations rules used by the base api controller
20 20
      * to check before add.
21 21
      * @var array
22 22
      */
23
-    protected $validationRules  = [
23
+    protected $validationRules = [
24 24
         'name'     => 'required|max:255',
25 25
         'redirect' => 'required|url',
26 26
         'user_id'  => 'required|exists:users,id',
Please login to merge, or discard this patch.
src/Modules/V1/Acl/Proxy/LoginProxy.php 1 patch
Indentation   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -5,105 +5,105 @@
 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) 
19
-    {
20
-
21
-        $this->userRepository = $app->make('App\Modules\V1\Acl\Repositories\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
-        $this->userRepository->login($credentials, $adminLogin);
38
-
39
-        return $this->proxy('password', [
40
-            'username' => $credentials['email'],
41
-            'password' => $credentials['password']
42
-        ]);
43
-    }
44
-
45
-    /**
46
-     * Attempt to refresh the access token useing the given refresh token.
47
-     * 
48
-     * @param  string $refreshToken
49
-     * @return array
50
-     */
51
-    public function refreshtoken($refreshToken)
52
-    {
53
-        return $this->proxy('refresh_token', [
54
-            'refresh_token' => $refreshToken
55
-        ]);
56
-    }
57
-
58
-    /**
59
-     * Proxy a request to the OAuth server.
60
-     *
61
-     * @param string $grantType what type of grant type should be proxied
62
-     * @param array 
63
-     */
64
-    public function proxy($grantType, array $data = [])
65
-    {
66
-        $data = array_merge($data, [
67
-            'client_id'     => env('PASSWORD_CLIENT_ID'),
68
-            'client_secret' => env('PASSWORD_CLIENT_SECRET'),
69
-            'grant_type'    => $grantType
70
-        ]);
71
-
72
-        $response = $this->apiConsumer->post('/oauth/token', $data);
73
-
74
-        if ( ! $response->isSuccessful()) 
75
-        {
76
-            if ($grantType == 'refresh_token') 
77
-            {
78
-                \ErrorHandler::invalidRefreshToken();
79
-            }
80
-
81
-            \ErrorHandler::loginFailed();
82
-        }
83
-
84
-        $data = json_decode($response->getContent());
85
-
86
-        return [
87
-            'access_token'  => $data->access_token,
88
-            'refresh_token' => $data->refresh_token,
89
-            'expires_in'    => $data->expires_in
90
-        ];
91
-    }
92
-
93
-    /**
94
-     * Logs out the user. We revoke access token and refresh token.
95
-     */
96
-    public function logout()
97
-    {
98
-        $accessToken = $this->auth->user()->token();
99
-
100
-        $this->db
101
-            ->table('oauth_refresh_tokens')
102
-            ->where('access_token_id', $accessToken->id)
103
-            ->update([
104
-                'revoked' => true
105
-            ]);
106
-
107
-        $accessToken->revoke();
108
-    }
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) 
19
+	{
20
+
21
+		$this->userRepository = $app->make('App\Modules\V1\Acl\Repositories\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
+		$this->userRepository->login($credentials, $adminLogin);
38
+
39
+		return $this->proxy('password', [
40
+			'username' => $credentials['email'],
41
+			'password' => $credentials['password']
42
+		]);
43
+	}
44
+
45
+	/**
46
+	 * Attempt to refresh the access token useing the given refresh token.
47
+	 * 
48
+	 * @param  string $refreshToken
49
+	 * @return array
50
+	 */
51
+	public function refreshtoken($refreshToken)
52
+	{
53
+		return $this->proxy('refresh_token', [
54
+			'refresh_token' => $refreshToken
55
+		]);
56
+	}
57
+
58
+	/**
59
+	 * Proxy a request to the OAuth server.
60
+	 *
61
+	 * @param string $grantType what type of grant type should be proxied
62
+	 * @param array 
63
+	 */
64
+	public function proxy($grantType, array $data = [])
65
+	{
66
+		$data = array_merge($data, [
67
+			'client_id'     => env('PASSWORD_CLIENT_ID'),
68
+			'client_secret' => env('PASSWORD_CLIENT_SECRET'),
69
+			'grant_type'    => $grantType
70
+		]);
71
+
72
+		$response = $this->apiConsumer->post('/oauth/token', $data);
73
+
74
+		if ( ! $response->isSuccessful()) 
75
+		{
76
+			if ($grantType == 'refresh_token') 
77
+			{
78
+				\ErrorHandler::invalidRefreshToken();
79
+			}
80
+
81
+			\ErrorHandler::loginFailed();
82
+		}
83
+
84
+		$data = json_decode($response->getContent());
85
+
86
+		return [
87
+			'access_token'  => $data->access_token,
88
+			'refresh_token' => $data->refresh_token,
89
+			'expires_in'    => $data->expires_in
90
+		];
91
+	}
92
+
93
+	/**
94
+	 * Logs out the user. We revoke access token and refresh token.
95
+	 */
96
+	public function logout()
97
+	{
98
+		$accessToken = $this->auth->user()->token();
99
+
100
+		$this->db
101
+			->table('oauth_refresh_tokens')
102
+			->where('access_token_id', $accessToken->id)
103
+			->update([
104
+				'revoked' => true
105
+			]);
106
+
107
+		$accessToken->revoke();
108
+	}
109 109
 }
110 110
\ No newline at end of file
Please login to merge, or discard this patch.
src/Modules/V1/Reporting/Repositories/ReportRepository.php 3 patches
Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -4,67 +4,67 @@
 block discarded – undo
4 4
 
5 5
 class ReportRepository extends AbstractRepository
6 6
 {
7
-    /**
8
-     * Return the model full namespace.
9
-     * 
10
-     * @return string
11
-     */
12
-    protected function getModel()
13
-    {
14
-        return 'App\Modules\V1\Reporting\Report';
15
-    }
7
+	/**
8
+	 * Return the model full namespace.
9
+	 * 
10
+	 * @return string
11
+	 */
12
+	protected function getModel()
13
+	{
14
+		return 'App\Modules\V1\Reporting\Report';
15
+	}
16 16
 
17
-    /**
18
-     * Render the given report db view based on the given
19
-     * condition.
20
-     *
21
-     * @param  string  $reportName
22
-     * @param  array   $conditions array of conditions
23
-     * @param  integer $perPage
24
-     * @param  array   $relations
25
-     * @param  boolean   $skipPermission
26
-     * @return object
27
-     */
28
-    public function getReport($reportName, $conditions = false, $perPage = 0, $relations = [], $skipPermission = false)
29
-    {
30
-        /**
31
-         * Fetch the report from db.
32
-         */
33
-        $reportConditions = $this->constructConditions(['report_name' => $reportName], $this->model);
34
-        $report           = call_user_func_array("{$this->getModel()}::with", array($relations))->whereRaw($reportConditions['conditionString'], $reportConditions['conditionValues'])->first();
17
+	/**
18
+	 * Render the given report db view based on the given
19
+	 * condition.
20
+	 *
21
+	 * @param  string  $reportName
22
+	 * @param  array   $conditions array of conditions
23
+	 * @param  integer $perPage
24
+	 * @param  array   $relations
25
+	 * @param  boolean   $skipPermission
26
+	 * @return object
27
+	 */
28
+	public function getReport($reportName, $conditions = false, $perPage = 0, $relations = [], $skipPermission = false)
29
+	{
30
+		/**
31
+		 * Fetch the report from db.
32
+		 */
33
+		$reportConditions = $this->constructConditions(['report_name' => $reportName], $this->model);
34
+		$report           = call_user_func_array("{$this->getModel()}::with", array($relations))->whereRaw($reportConditions['conditionString'], $reportConditions['conditionValues'])->first();
35 35
         
36
-        /**
37
-         * Check report existance and permission.
38
-         */
39
-        if ( ! $report) 
40
-        {
41
-            \ErrorHandler::notFound('report');
42
-        }
43
-        else if (! $skipPermission && ! \Core::users()->can($report->view_name, 'reports'))
44
-        {
45
-            \ErrorHandler::noPermissions();
46
-        }
36
+		/**
37
+		 * Check report existance and permission.
38
+		 */
39
+		if ( ! $report) 
40
+		{
41
+			\ErrorHandler::notFound('report');
42
+		}
43
+		else if (! $skipPermission && ! \Core::users()->can($report->view_name, 'reports'))
44
+		{
45
+			\ErrorHandler::noPermissions();
46
+		}
47 47
 
48
-        /**
49
-         * Fetch data from the report based on the given conditions.
50
-         */
51
-        $report = \DB::table($report->view_name);
52
-        unset($conditions['page']);
53
-        if (count($conditions))
54
-        {
55
-            $conditions = $this->constructConditions($conditions, $this->model);
56
-            $report->whereRaw($conditions['conditionString'], $conditions['conditionValues']);   
57
-        }
58
-        /**
59
-         * Paginate or all data.
60
-         */
61
-        if ($perPage) 
62
-        {
63
-            return $report->paginate($perPage);
64
-        }
65
-        else
66
-        {
67
-            return $report->get();  
68
-        }
69
-    }
48
+		/**
49
+		 * Fetch data from the report based on the given conditions.
50
+		 */
51
+		$report = \DB::table($report->view_name);
52
+		unset($conditions['page']);
53
+		if (count($conditions))
54
+		{
55
+			$conditions = $this->constructConditions($conditions, $this->model);
56
+			$report->whereRaw($conditions['conditionString'], $conditions['conditionValues']);   
57
+		}
58
+		/**
59
+		 * Paginate or all data.
60
+		 */
61
+		if ($perPage) 
62
+		{
63
+			return $report->paginate($perPage);
64
+		}
65
+		else
66
+		{
67
+			return $report->get();  
68
+		}
69
+	}
70 70
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
         {
41 41
             \ErrorHandler::notFound('report');
42 42
         }
43
-        else if (! $skipPermission && ! \Core::users()->can($report->view_name, 'reports'))
43
+        else if ( ! $skipPermission && ! \Core::users()->can($report->view_name, 'reports'))
44 44
         {
45 45
             \ErrorHandler::noPermissions();
46 46
         }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,8 +39,7 @@  discard block
 block discarded – undo
39 39
         if ( ! $report) 
40 40
         {
41 41
             \ErrorHandler::notFound('report');
42
-        }
43
-        else if (! $skipPermission && ! \Core::users()->can($report->view_name, 'reports'))
42
+        } else if (! $skipPermission && ! \Core::users()->can($report->view_name, 'reports'))
44 43
         {
45 44
             \ErrorHandler::noPermissions();
46 45
         }
@@ -61,8 +60,7 @@  discard block
 block discarded – undo
61 60
         if ($perPage) 
62 61
         {
63 62
             return $report->paginate($perPage);
64
-        }
65
-        else
63
+        } else
66 64
         {
67 65
             return $report->get();  
68 66
         }
Please login to merge, or discard this patch.
src/Modules/V1/Notifications/Notification.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -5,23 +5,23 @@
 block discarded – undo
5 5
 
6 6
 class Notification extends DatabaseNotification{
7 7
 
8
-    public function getCreatedAtAttribute($value)
9
-    {
10
-        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
11
-    }
8
+	public function getCreatedAtAttribute($value)
9
+	{
10
+		return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
11
+	}
12 12
 
13
-    public function getUpdatedAtAttribute($value)
14
-    {
15
-        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
16
-    }
13
+	public function getUpdatedAtAttribute($value)
14
+	{
15
+		return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
16
+	}
17 17
 
18
-    public function getDeletedAtAttribute($value)
19
-    {
20
-        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
21
-    }
18
+	public function getDeletedAtAttribute($value)
19
+	{
20
+		return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
21
+	}
22 22
 
23
-    public function getReadAtAttribute($value)
24
-    {
25
-        return ! $value ? false : \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
26
-    }
23
+	public function getReadAtAttribute($value)
24
+	{
25
+		return ! $value ? false : \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
26
+	}
27 27
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 use Illuminate\Notifications\DatabaseNotification;
4 4
 use Illuminate\Database\Eloquent\SoftDeletes;
5 5
 
6
-class Notification extends DatabaseNotification{
6
+class Notification extends DatabaseNotification {
7 7
 
8 8
     public function getCreatedAtAttribute($value)
9 9
     {
Please login to merge, or discard this patch.
src/Modules/V1/Acl/ModelObservers/AclUserObserver.php 1 patch
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -5,56 +5,56 @@
 block discarded – undo
5 5
  */
6 6
 class AclUserObserver {
7 7
 
8
-    public function saving($model)
9
-    {
10
-        //
11
-    }
12
-
13
-    public function saved($model)
14
-    {
15
-        //
16
-    }
17
-
18
-    public function creating($model)
19
-    {
20
-        //
21
-    }
22
-
23
-    public function created($model)
24
-    {
25
-        //
26
-    }
27
-
28
-    public function updating($model)
29
-    {
30
-        //
31
-    }
32
-
33
-    public function updated($model)
34
-    {
35
-        //
36
-    }
37
-
38
-    public function deleting($model)
39
-    {
40
-        if ($model->getOriginal('id') == \Auth::id()) 
41
-        {
42
-            \ErrorHandler::noPermissions();
43
-        }
44
-    }
45
-
46
-    public function deleted($model)
47
-    {
48
-        //
49
-    }
50
-
51
-    public function restoring($model)
52
-    {
53
-        //
54
-    }
55
-
56
-    public function restored($model)
57
-    {
58
-        //
59
-    }
8
+	public function saving($model)
9
+	{
10
+		//
11
+	}
12
+
13
+	public function saved($model)
14
+	{
15
+		//
16
+	}
17
+
18
+	public function creating($model)
19
+	{
20
+		//
21
+	}
22
+
23
+	public function created($model)
24
+	{
25
+		//
26
+	}
27
+
28
+	public function updating($model)
29
+	{
30
+		//
31
+	}
32
+
33
+	public function updated($model)
34
+	{
35
+		//
36
+	}
37
+
38
+	public function deleting($model)
39
+	{
40
+		if ($model->getOriginal('id') == \Auth::id()) 
41
+		{
42
+			\ErrorHandler::noPermissions();
43
+		}
44
+	}
45
+
46
+	public function deleted($model)
47
+	{
48
+		//
49
+	}
50
+
51
+	public function restoring($model)
52
+	{
53
+		//
54
+	}
55
+
56
+	public function restored($model)
57
+	{
58
+		//
59
+	}
60 60
 }
61 61
\ No newline at end of file
Please login to merge, or discard this patch.
src/Modules/V1/Notifications/Notifications/ResetPassword.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
      * Get the notification's delivery channels.
29 29
      *
30 30
      * @param  mixed  $notifiable
31
-     * @return array
31
+     * @return string[]
32 32
      */
33 33
     public function via($notifiable)
34 34
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
6 6
 use Illuminate\Notifications\Notification;
7 7
 use Illuminate\Contracts\Queue\ShouldQueue;
8 8
 use Illuminate\Notifications\Messages\MailMessage;
9
-use Illuminate\Notifications\Messages\BroadcastMessage;
10 9
 
11 10
 class ResetPassword extends Notification implements ShouldQueue
12 11
 {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,6 +47,6 @@
 block discarded – undo
47 47
             ->subject('Reset passowrd')
48 48
             ->line('Reset passowrd')
49 49
             ->line('To reset your password click on the button below')
50
-            ->action('Reset password', env('RESET_PASSWORD_URL') . '/' . $this->token);
50
+            ->action('Reset password', env('RESET_PASSWORD_URL').'/'.$this->token);
51 51
     }
52 52
 }
53 53
\ No newline at end of file
Please login to merge, or discard this patch.
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -10,43 +10,43 @@
 block discarded – undo
10 10
 
11 11
 class ResetPassword extends Notification implements ShouldQueue
12 12
 {
13
-    use Queueable;
13
+	use Queueable;
14 14
 
15
-    protected $token;
15
+	protected $token;
16 16
 
17
-    /**
18
-     * Create a new notification instance.
19
-     *
20
-     * @return void
21
-     */
22
-    public function __construct($token)
23
-    {
24
-        $this->token = $token;
25
-    }
17
+	/**
18
+	 * Create a new notification instance.
19
+	 *
20
+	 * @return void
21
+	 */
22
+	public function __construct($token)
23
+	{
24
+		$this->token = $token;
25
+	}
26 26
 
27
-    /**
28
-     * Get the notification's delivery channels.
29
-     *
30
-     * @param  mixed  $notifiable
31
-     * @return array
32
-     */
33
-    public function via($notifiable)
34
-    {
35
-        return ['mail'];
36
-    }
27
+	/**
28
+	 * Get the notification's delivery channels.
29
+	 *
30
+	 * @param  mixed  $notifiable
31
+	 * @return array
32
+	 */
33
+	public function via($notifiable)
34
+	{
35
+		return ['mail'];
36
+	}
37 37
 
38
-    /**
39
-     * Get the mail representation of the notification.
40
-     *
41
-     * @param  mixed  $notifiable
42
-     * @return \Illuminate\Notifications\Messages\MailMessage
43
-     */
44
-    public function toMail($notifiable)
45
-    {
46
-        return (new MailMessage)
47
-            ->subject('Reset passowrd')
48
-            ->line('Reset passowrd')
49
-            ->line('To reset your password click on the button below')
50
-            ->action('Reset password', env('RESET_PASSWORD_URL') . '/' . $this->token);
51
-    }
38
+	/**
39
+	 * Get the mail representation of the notification.
40
+	 *
41
+	 * @param  mixed  $notifiable
42
+	 * @return \Illuminate\Notifications\Messages\MailMessage
43
+	 */
44
+	public function toMail($notifiable)
45
+	{
46
+		return (new MailMessage)
47
+			->subject('Reset passowrd')
48
+			->line('Reset passowrd')
49
+			->line('To reset your password click on the button below')
50
+			->action('Reset password', env('RESET_PASSWORD_URL') . '/' . $this->token);
51
+	}
52 52
 }
53 53
\ No newline at end of file
Please login to merge, or discard this patch.