Completed
Push — master ( c7d5ad...0208a8 )
by Sherif
02:59
created
src/Modules/Core/AbstractRepositories/AbstractRepositoryContainer.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -4,35 +4,35 @@
 block discarded – undo
4 4
 
5 5
 abstract class AbstractRepositoryContainer implements RepositoryContainerInterface
6 6
 {
7
-    /**
8
-     * Construct the repository class name based on
9
-     * the method name called, search in the 
10
-     * given namespaces for the class and 
11
-     * return an instance.
12
-     * 
13
-     * @param  string $name the called method name
14
-     * @param  array  $arguments the method arguments
15
-     * @return object
16
-     */
7
+	/**
8
+	 * Construct the repository class name based on
9
+	 * the method name called, search in the 
10
+	 * given namespaces for the class and 
11
+	 * return an instance.
12
+	 * 
13
+	 * @param  string $name the called method name
14
+	 * @param  array  $arguments the method arguments
15
+	 * @return object
16
+	 */
17 17
 	public function __call($name, $arguments)
18
-    {
19
-    	foreach ($this->getRepoNameSpace() as $repoNameSpace) 
20
-    	{
21
-            $apiVersion = \Request::header('api-version') ?: 1;
22
-            $class      = rtrim($repoNameSpace, '\\') . '\\V' . $apiVersion .'\\' . ucfirst(str_singular($name)) . 'Repository';
23
-    		if (class_exists($class)) 
24
-    		{
25
-        		return \App::make($class);
26
-    		}
27
-    	}
28
-    }
18
+	{
19
+		foreach ($this->getRepoNameSpace() as $repoNameSpace) 
20
+		{
21
+			$apiVersion = \Request::header('api-version') ?: 1;
22
+			$class      = rtrim($repoNameSpace, '\\') . '\\V' . $apiVersion .'\\' . ucfirst(str_singular($name)) . 'Repository';
23
+			if (class_exists($class)) 
24
+			{
25
+				return \App::make($class);
26
+			}
27
+		}
28
+	}
29 29
 
30
-     /**
31
-     * Abstract methods that return the necessary 
32
-     * information (repositories namespaces)
33
-     * needed to preform the previous actions.
34
-     * 
35
-     * @return array
36
-     */
37
-    abstract protected function getRepoNameSpace();
30
+	 /**
31
+	  * Abstract methods that return the necessary 
32
+	  * information (repositories namespaces)
33
+	  * needed to preform the previous actions.
34
+	  * 
35
+	  * @return array
36
+	  */
37
+	abstract protected function getRepoNameSpace();
38 38
 }
39 39
\ No newline at end of file
Please login to merge, or discard this patch.
src/Modules/Reporting/Database/Migrations/2016_01_24_123631_initialize.php 1 patch
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -12,71 +12,71 @@
 block discarded – undo
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', ['reports'])->delete();
19 19
 
20 20
 		/**
21
-         * Insert the permissions related to this module.
22
-         */
23
-        DB::table('permissions')->insert(
24
-        	[
25
-        		/**
26
-        		 * Reporting model permissions.
27
-        		 */
28
-	        	[
29
-	        	'name'       => 'find',
30
-	        	'model'      => 'reports',
31
-	        	'created_at' => \DB::raw('NOW()'),
32
-	        	'updated_at' => \DB::raw('NOW()')
33
-	        	],
34
-	        	[
35
-	        	'name'       => 'search',
36
-	        	'model'      => 'reports',
37
-	        	'created_at' => \DB::raw('NOW()'),
38
-	        	'updated_at' => \DB::raw('NOW()')
39
-	        	],
40
-	        	[
41
-	        	'name'       => 'list',
42
-	        	'model'      => 'reports',
43
-	        	'created_at' => \DB::raw('NOW()'),
44
-	        	'updated_at' => \DB::raw('NOW()')
45
-	        	],
46
-	        	[
47
-	        	'name'       => 'findby',
48
-	        	'model'      => 'reports',
49
-	        	'created_at' => \DB::raw('NOW()'),
50
-	        	'updated_at' => \DB::raw('NOW()')
51
-	        	],
52
-	        	[
53
-	        	'name'       => 'first',
54
-	        	'model'      => 'reports',
55
-	        	'created_at' => \DB::raw('NOW()'),
56
-	        	'updated_at' => \DB::raw('NOW()')
57
-	        	],
58
-	        	[
59
-	        	'name'       => 'paginate',
60
-	        	'model'      => 'reports',
61
-	        	'created_at' => \DB::raw('NOW()'),
62
-	        	'updated_at' => \DB::raw('NOW()')
63
-	        	],
64
-	        	[
65
-	        	'name'       => 'paginateby',
66
-	        	'model'      => 'reports',
67
-	        	'created_at' => \DB::raw('NOW()'),
68
-	        	'updated_at' => \DB::raw('NOW()')
69
-	        	],
70
-	        	[
71
-	        	'name'       => 'admin_count',
72
-	        	'model'      => 'reports',
73
-	        	'created_at' => \DB::raw('NOW()'),
74
-	        	'updated_at' => \DB::raw('NOW()')
75
-	        	]
76
-        	]
77
-        );
21
+		 * Insert the permissions related to this module.
22
+		 */
23
+		DB::table('permissions')->insert(
24
+			[
25
+				/**
26
+				 * Reporting model permissions.
27
+				 */
28
+				[
29
+				'name'       => 'find',
30
+				'model'      => 'reports',
31
+				'created_at' => \DB::raw('NOW()'),
32
+				'updated_at' => \DB::raw('NOW()')
33
+				],
34
+				[
35
+				'name'       => 'search',
36
+				'model'      => 'reports',
37
+				'created_at' => \DB::raw('NOW()'),
38
+				'updated_at' => \DB::raw('NOW()')
39
+				],
40
+				[
41
+				'name'       => 'list',
42
+				'model'      => 'reports',
43
+				'created_at' => \DB::raw('NOW()'),
44
+				'updated_at' => \DB::raw('NOW()')
45
+				],
46
+				[
47
+				'name'       => 'findby',
48
+				'model'      => 'reports',
49
+				'created_at' => \DB::raw('NOW()'),
50
+				'updated_at' => \DB::raw('NOW()')
51
+				],
52
+				[
53
+				'name'       => 'first',
54
+				'model'      => 'reports',
55
+				'created_at' => \DB::raw('NOW()'),
56
+				'updated_at' => \DB::raw('NOW()')
57
+				],
58
+				[
59
+				'name'       => 'paginate',
60
+				'model'      => 'reports',
61
+				'created_at' => \DB::raw('NOW()'),
62
+				'updated_at' => \DB::raw('NOW()')
63
+				],
64
+				[
65
+				'name'       => 'paginateby',
66
+				'model'      => 'reports',
67
+				'created_at' => \DB::raw('NOW()'),
68
+				'updated_at' => \DB::raw('NOW()')
69
+				],
70
+				[
71
+				'name'       => 'admin_count',
72
+				'model'      => 'reports',
73
+				'created_at' => \DB::raw('NOW()'),
74
+				'updated_at' => \DB::raw('NOW()')
75
+				]
76
+			]
77
+		);
78 78
 
79
-        /**
79
+		/**
80 80
 		 * Assign the permissions to the admin group.
81 81
 		 */
82 82
 		$permissionIds = DB::table('permissions')->whereIn('model', ['reports'])->select('id')->lists('id');
Please login to merge, or discard this patch.
src/Modules/Reporting/Repositories/V1/ReportRepository.php 1 patch
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -11,60 +11,60 @@
 block discarded – undo
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\Reporting\Report';
16 16
 	}
17 17
 
18 18
 	/**
19
-     * Render the given report db view.
20
-     * 
21
-     * @param  integer $id
22
-     * @param  array   $relations
23
-     * @param  array   $columns
24
-     * @return object
25
-     */
26
-    public function find($id, $relations = [], $columns = array('*'))
27
-    {
19
+	 * Render the given report db view.
20
+	 * 
21
+	 * @param  integer $id
22
+	 * @param  array   $relations
23
+	 * @param  array   $columns
24
+	 * @return object
25
+	 */
26
+	public function find($id, $relations = [], $columns = array('*'))
27
+	{
28 28
 		$report = call_user_func_array("{$this->getModel()}::with", array($relations))->find($id, $columns);
29 29
 
30
-        if ( ! \Core::users()->can($report->view_name, 'reports'))
31
-        {
32
-            $error = $this->errorHandler->noPermissions();
33
-            abort($error['status'], $error['message']);
34
-        }
30
+		if ( ! \Core::users()->can($report->view_name, 'reports'))
31
+		{
32
+			$error = $this->errorHandler->noPermissions();
33
+			abort($error['status'], $error['message']);
34
+		}
35 35
 
36 36
 		if ( ! $report) 
37 37
 		{
38 38
 			$error = $this->errorHandler->notFound('report');
39 39
 			abort($error['status'], $error['message']);
40 40
 		}
41
-        return \DB::table($report->view_name)->get();
42
-    }
41
+		return \DB::table($report->view_name)->get();
42
+	}
43 43
 
44
-    /**
45
-     * Render the given report db view based on the given
46
-     * condition.
47
-     *
48
-     * @param  array   $conditions array of conditions
49
-     * @param  array   $relations
50
-     * @param  array   $colunmns
51
-     * @return object
52
-     */
53
-    public function first($conditions, $relations = [], $columns = array('*'))
54
-    {
44
+	/**
45
+	 * Render the given report db view based on the given
46
+	 * condition.
47
+	 *
48
+	 * @param  array   $conditions array of conditions
49
+	 * @param  array   $relations
50
+	 * @param  array   $colunmns
51
+	 * @return object
52
+	 */
53
+	public function first($conditions, $relations = [], $columns = array('*'))
54
+	{
55 55
 		$conditions = $this->constructConditions($conditions);
56 56
 		$report     = call_user_func_array("{$this->getModel()}::with", array($relations))->whereRaw($conditions['conditionString'], $conditions['conditionValues'])->first($columns);
57 57
         
58
-        if ( ! \Core::users()->can($report->view_name, 'reports'))
59
-        {
60
-            $error = $this->errorHandler->noPermissions();
61
-            abort($error['status'], $error['message']);
62
-        }
58
+		if ( ! \Core::users()->can($report->view_name, 'reports'))
59
+		{
60
+			$error = $this->errorHandler->noPermissions();
61
+			abort($error['status'], $error['message']);
62
+		}
63 63
 		if ( ! $report) 
64 64
 		{
65 65
 			$error = $this->errorHandler->notFound('report');
66 66
 			abort($error['status'], $error['message']);
67 67
 		}
68
-        return \DB::table($report->view_name)->get();  
69
-    }
68
+		return \DB::table($report->view_name)->get();  
69
+	}
70 70
 }
Please login to merge, or discard this patch.
src/Modules/Notifications/Repositories/V1/NotificationRepository.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -11,28 +11,28 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Kernel.php 1 patch
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -7,44 +7,44 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.