@@ -15,6 +15,6 @@ |
||
15 | 15 | |
16 | 16 | $apiVersion = \Request::header('api-version') ?: 1; |
17 | 17 | Route::controllers([ |
18 | - 'reports' => 'V' . $apiVersion . '\ReportingController', |
|
18 | + 'reports' => 'V'.$apiVersion.'\ReportingController', |
|
19 | 19 | ]); |
20 | 20 | }); |
21 | 21 | \ No newline at end of file |
@@ -8,16 +8,16 @@ |
||
8 | 8 | class ReportsController extends BaseApiController |
9 | 9 | { |
10 | 10 | /** |
11 | - * The name of the model that is used by the base api controller |
|
12 | - * to preform actions like (add, edit ... etc). |
|
13 | - * @var string |
|
14 | - */ |
|
15 | - protected $model = 'reports'; |
|
11 | + * The name of the model that is used by the base api controller |
|
12 | + * to preform actions like (add, edit ... etc). |
|
13 | + * @var string |
|
14 | + */ |
|
15 | + protected $model = 'reports'; |
|
16 | 16 | |
17 | - /** |
|
18 | - * List of all route actions that the base api controller |
|
19 | - * will skip permissions check for them. |
|
20 | - * @var array |
|
21 | - */ |
|
22 | - protected $skipPermissionCheck = ['find', 'first']; |
|
17 | + /** |
|
18 | + * List of all route actions that the base api controller |
|
19 | + * will skip permissions check for them. |
|
20 | + * @var array |
|
21 | + */ |
|
22 | + protected $skipPermissionCheck = ['find', 'first']; |
|
23 | 23 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | * to preform actions like (add, edit ... etc). |
13 | 13 | * @var string |
14 | 14 | */ |
15 | - protected $model = 'reports'; |
|
15 | + protected $model = 'reports'; |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * List of all route actions that the base api controller |
@@ -12,77 +12,77 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - /** |
|
16 | - * Delete previous permissions. |
|
17 | - */ |
|
15 | + /** |
|
16 | + * Delete previous permissions. |
|
17 | + */ |
|
18 | 18 | DB::table('permissions')->whereIn('model', ['notifications'])->delete(); |
19 | 19 | |
20 | 20 | /** |
21 | - * Insert the permissions related to this module. |
|
22 | - */ |
|
23 | - DB::table('permissions')->insert( |
|
24 | - [ |
|
25 | - /** |
|
26 | - * Logs model permissions. |
|
27 | - */ |
|
28 | - [ |
|
29 | - 'name' => 'find', |
|
30 | - 'model' => 'notifications', |
|
31 | - 'created_at' => \DB::raw('NOW()'), |
|
32 | - 'updated_at' => \DB::raw('NOW()') |
|
33 | - ], |
|
34 | - [ |
|
35 | - 'name' => 'search', |
|
36 | - 'model' => 'notifications', |
|
37 | - 'created_at' => \DB::raw('NOW()'), |
|
38 | - 'updated_at' => \DB::raw('NOW()') |
|
39 | - ], |
|
40 | - [ |
|
41 | - 'name' => 'list', |
|
42 | - 'model' => 'notifications', |
|
43 | - 'created_at' => \DB::raw('NOW()'), |
|
44 | - 'updated_at' => \DB::raw('NOW()') |
|
45 | - ], |
|
46 | - [ |
|
47 | - 'name' => 'findby', |
|
48 | - 'model' => 'notifications', |
|
49 | - 'created_at' => \DB::raw('NOW()'), |
|
50 | - 'updated_at' => \DB::raw('NOW()') |
|
51 | - ], |
|
52 | - [ |
|
53 | - 'name' => 'first', |
|
54 | - 'model' => 'notifications', |
|
55 | - 'created_at' => \DB::raw('NOW()'), |
|
56 | - 'updated_at' => \DB::raw('NOW()') |
|
57 | - ], |
|
58 | - [ |
|
59 | - 'name' => 'paginate', |
|
60 | - 'model' => 'notifications', |
|
61 | - 'created_at' => \DB::raw('NOW()'), |
|
62 | - 'updated_at' => \DB::raw('NOW()') |
|
63 | - ], |
|
64 | - [ |
|
65 | - 'name' => 'paginateby', |
|
66 | - 'model' => 'notifications', |
|
67 | - 'created_at' => \DB::raw('NOW()'), |
|
68 | - 'updated_at' => \DB::raw('NOW()') |
|
69 | - ], |
|
70 | - [ |
|
71 | - 'name' => 'notified', |
|
72 | - 'model' => 'notifications', |
|
73 | - 'created_at' => \DB::raw('NOW()'), |
|
74 | - 'updated_at' => \DB::raw('NOW()') |
|
75 | - ], |
|
76 | - [ |
|
77 | - 'name' => 'notifyall', |
|
78 | - 'model' => 'notifications', |
|
79 | - 'created_at' => \DB::raw('NOW()'), |
|
80 | - 'updated_at' => \DB::raw('NOW()') |
|
81 | - ], |
|
82 | - ] |
|
83 | - ); |
|
21 | + * Insert the permissions related to this module. |
|
22 | + */ |
|
23 | + DB::table('permissions')->insert( |
|
24 | + [ |
|
25 | + /** |
|
26 | + * Logs model permissions. |
|
27 | + */ |
|
28 | + [ |
|
29 | + 'name' => 'find', |
|
30 | + 'model' => 'notifications', |
|
31 | + 'created_at' => \DB::raw('NOW()'), |
|
32 | + 'updated_at' => \DB::raw('NOW()') |
|
33 | + ], |
|
34 | + [ |
|
35 | + 'name' => 'search', |
|
36 | + 'model' => 'notifications', |
|
37 | + 'created_at' => \DB::raw('NOW()'), |
|
38 | + 'updated_at' => \DB::raw('NOW()') |
|
39 | + ], |
|
40 | + [ |
|
41 | + 'name' => 'list', |
|
42 | + 'model' => 'notifications', |
|
43 | + 'created_at' => \DB::raw('NOW()'), |
|
44 | + 'updated_at' => \DB::raw('NOW()') |
|
45 | + ], |
|
46 | + [ |
|
47 | + 'name' => 'findby', |
|
48 | + 'model' => 'notifications', |
|
49 | + 'created_at' => \DB::raw('NOW()'), |
|
50 | + 'updated_at' => \DB::raw('NOW()') |
|
51 | + ], |
|
52 | + [ |
|
53 | + 'name' => 'first', |
|
54 | + 'model' => 'notifications', |
|
55 | + 'created_at' => \DB::raw('NOW()'), |
|
56 | + 'updated_at' => \DB::raw('NOW()') |
|
57 | + ], |
|
58 | + [ |
|
59 | + 'name' => 'paginate', |
|
60 | + 'model' => 'notifications', |
|
61 | + 'created_at' => \DB::raw('NOW()'), |
|
62 | + 'updated_at' => \DB::raw('NOW()') |
|
63 | + ], |
|
64 | + [ |
|
65 | + 'name' => 'paginateby', |
|
66 | + 'model' => 'notifications', |
|
67 | + 'created_at' => \DB::raw('NOW()'), |
|
68 | + 'updated_at' => \DB::raw('NOW()') |
|
69 | + ], |
|
70 | + [ |
|
71 | + 'name' => 'notified', |
|
72 | + 'model' => 'notifications', |
|
73 | + 'created_at' => \DB::raw('NOW()'), |
|
74 | + 'updated_at' => \DB::raw('NOW()') |
|
75 | + ], |
|
76 | + [ |
|
77 | + 'name' => 'notifyall', |
|
78 | + 'model' => 'notifications', |
|
79 | + 'created_at' => \DB::raw('NOW()'), |
|
80 | + 'updated_at' => \DB::raw('NOW()') |
|
81 | + ], |
|
82 | + ] |
|
83 | + ); |
|
84 | 84 | |
85 | - /** |
|
85 | + /** |
|
86 | 86 | * Assign the permissions to the admin group. |
87 | 87 | */ |
88 | 88 | $permissionIds = DB::table('permissions')->whereIn('model', ['notifications'])->select('id')->lists('id'); |
@@ -11,28 +11,28 @@ |
||
11 | 11 | */ |
12 | 12 | protected function getModel() |
13 | 13 | { |
14 | - $apiVersion = \Request::header('api-version') ?: 1; |
|
14 | + $apiVersion = \Request::header('api-version') ?: 1; |
|
15 | 15 | return 'App\Modules\Notifications\Notification'; |
16 | 16 | } |
17 | 17 | |
18 | 18 | /** |
19 | - * Set the notification notified to true. |
|
20 | - * |
|
21 | - * @param integer $id |
|
22 | - * @return object |
|
23 | - */ |
|
24 | - public function notified($id) |
|
25 | - { |
|
26 | - return $this->save(['id' => $id, 'notified' => 1]); |
|
27 | - } |
|
19 | + * Set the notification notified to true. |
|
20 | + * |
|
21 | + * @param integer $id |
|
22 | + * @return object |
|
23 | + */ |
|
24 | + public function notified($id) |
|
25 | + { |
|
26 | + return $this->save(['id' => $id, 'notified' => 1]); |
|
27 | + } |
|
28 | 28 | |
29 | - /** |
|
30 | - * Set the notification notified to all. |
|
31 | - * |
|
32 | - * @return void |
|
33 | - */ |
|
34 | - public function notifyAll() |
|
35 | - { |
|
36 | - \Core::notifications()->update(false, ['notified' => 1], 'notified'); |
|
37 | - } |
|
29 | + /** |
|
30 | + * Set the notification notified to all. |
|
31 | + * |
|
32 | + * @return void |
|
33 | + */ |
|
34 | + public function notifyAll() |
|
35 | + { |
|
36 | + \Core::notifications()->update(false, ['notified' => 1], 'notified'); |
|
37 | + } |
|
38 | 38 | } |
@@ -15,6 +15,6 @@ |
||
15 | 15 | |
16 | 16 | $apiVersion = \Request::header('api-version') ?: 1; |
17 | 17 | Route::controllers([ |
18 | - 'notifications' => 'V' . $apiVersion . '\NotificationsController', |
|
18 | + 'notifications' => 'V'.$apiVersion.'\NotificationsController', |
|
19 | 19 | ]); |
20 | 20 | }); |
21 | 21 | \ No newline at end of file |
@@ -8,30 +8,30 @@ |
||
8 | 8 | class NotificationsController extends BaseApiController |
9 | 9 | { |
10 | 10 | /** |
11 | - * The name of the model that is used by the base api controller |
|
12 | - * to preform actions like (add, edit ... etc). |
|
13 | - * @var string |
|
14 | - */ |
|
15 | - protected $model = 'notifications'; |
|
11 | + * The name of the model that is used by the base api controller |
|
12 | + * to preform actions like (add, edit ... etc). |
|
13 | + * @var string |
|
14 | + */ |
|
15 | + protected $model = 'notifications'; |
|
16 | 16 | |
17 | - /** |
|
18 | - * Set the notification notified to true. |
|
19 | - * |
|
20 | - * @param integer $id |
|
21 | - * @return \Illuminate\Http\Response |
|
22 | - */ |
|
23 | - public function getNotified($id) |
|
24 | - { |
|
25 | - return \Response::json(\Core::notifications()->notified($id), 200); |
|
26 | - } |
|
17 | + /** |
|
18 | + * Set the notification notified to true. |
|
19 | + * |
|
20 | + * @param integer $id |
|
21 | + * @return \Illuminate\Http\Response |
|
22 | + */ |
|
23 | + public function getNotified($id) |
|
24 | + { |
|
25 | + return \Response::json(\Core::notifications()->notified($id), 200); |
|
26 | + } |
|
27 | 27 | |
28 | - /** |
|
29 | - * Set the notification notified to all. |
|
30 | - * |
|
31 | - * @return \Illuminate\Http\Response |
|
32 | - */ |
|
33 | - public function getNotifyall() |
|
34 | - { |
|
35 | - return \Response::json(\Core::notifications()->notifyAll(), 200); |
|
36 | - } |
|
28 | + /** |
|
29 | + * Set the notification notified to all. |
|
30 | + * |
|
31 | + * @return \Illuminate\Http\Response |
|
32 | + */ |
|
33 | + public function getNotifyall() |
|
34 | + { |
|
35 | + return \Response::json(\Core::notifications()->notifyAll(), 200); |
|
36 | + } |
|
37 | 37 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | * to preform actions like (add, edit ... etc). |
13 | 13 | * @var string |
14 | 14 | */ |
15 | - protected $model = 'notifications'; |
|
15 | + protected $model = 'notifications'; |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Set the notification notified to true. |
@@ -7,44 +7,44 @@ |
||
7 | 7 | class Kernel extends HttpKernel |
8 | 8 | { |
9 | 9 | |
10 | - /** |
|
11 | - * The application's global HTTP middleware stack. |
|
12 | - * |
|
13 | - * These middleware are run during every request to your application. |
|
14 | - * |
|
15 | - * @var array |
|
16 | - */ |
|
17 | - protected $middleware = [ |
|
18 | - \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, |
|
19 | - ]; |
|
10 | + /** |
|
11 | + * The application's global HTTP middleware stack. |
|
12 | + * |
|
13 | + * These middleware are run during every request to your application. |
|
14 | + * |
|
15 | + * @var array |
|
16 | + */ |
|
17 | + protected $middleware = [ |
|
18 | + \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, |
|
19 | + ]; |
|
20 | 20 | |
21 | - /** |
|
22 | - * The application's global HTTP middleware stack. |
|
23 | - * |
|
24 | - * @var array |
|
25 | - */ |
|
26 | - protected $middlewareGroups = [ |
|
27 | - 'web' => [ |
|
28 | - \App\Http\Middleware\EncryptCookies::class, |
|
29 | - \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, |
|
30 | - \Illuminate\Session\Middleware\StartSession::class, |
|
31 | - \Illuminate\View\Middleware\ShareErrorsFromSession::class, |
|
32 | - //\App\Http\Middleware\VerifyCsrfToken::class, |
|
33 | - ], |
|
34 | - 'api' => [ |
|
35 | - 'throttle:60,1', |
|
36 | - ], |
|
37 | - ]; |
|
21 | + /** |
|
22 | + * The application's global HTTP middleware stack. |
|
23 | + * |
|
24 | + * @var array |
|
25 | + */ |
|
26 | + protected $middlewareGroups = [ |
|
27 | + 'web' => [ |
|
28 | + \App\Http\Middleware\EncryptCookies::class, |
|
29 | + \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, |
|
30 | + \Illuminate\Session\Middleware\StartSession::class, |
|
31 | + \Illuminate\View\Middleware\ShareErrorsFromSession::class, |
|
32 | + //\App\Http\Middleware\VerifyCsrfToken::class, |
|
33 | + ], |
|
34 | + 'api' => [ |
|
35 | + 'throttle:60,1', |
|
36 | + ], |
|
37 | + ]; |
|
38 | 38 | |
39 | - /** |
|
40 | - * The application's route middleware. |
|
41 | - * |
|
42 | - * @var array |
|
43 | - */ |
|
44 | - protected $routeMiddleware = [ |
|
45 | - 'auth' => \App\Http\Middleware\Authenticate::class, |
|
46 | - 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, |
|
47 | - 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, |
|
48 | - 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, |
|
49 | - ]; |
|
39 | + /** |
|
40 | + * The application's route middleware. |
|
41 | + * |
|
42 | + * @var array |
|
43 | + */ |
|
44 | + protected $routeMiddleware = [ |
|
45 | + 'auth' => \App\Http\Middleware\Authenticate::class, |
|
46 | + 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, |
|
47 | + 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, |
|
48 | + 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, |
|
49 | + ]; |
|
50 | 50 | } |