Completed
Push — master ( 9ecb5e...97e3cb )
by Sherif
13:30
created
src/Modules/V1/Core/Providers/RouteServiceProvider.php 1 patch
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -8,72 +8,72 @@
 block discarded – undo
8 8
 class RouteServiceProvider extends ServiceProvider
9 9
 {
10 10
 	/**
11
-     * This namespace is applied to your controller routes.
12
-     *
13
-     * In addition, it is set as the URL generator's root namespace.
14
-     *
15
-     * @var string
16
-     */
17
-    protected $namespace = 'App\Modules\V1\Core\Http\Controllers';
11
+	 * This namespace is applied to your controller routes.
12
+	 *
13
+	 * In addition, it is set as the URL generator's root namespace.
14
+	 *
15
+	 * @var string
16
+	 */
17
+	protected $namespace = 'App\Modules\V1\Core\Http\Controllers';
18 18
 
19
-    /**
20
-     * Define your route model bindings, pattern filters, etc.
21
-     *
22
-     * @return void
23
-     */
24
-    public function boot()
25
-    {
26
-        //
19
+	/**
20
+	 * Define your route model bindings, pattern filters, etc.
21
+	 *
22
+	 * @return void
23
+	 */
24
+	public function boot()
25
+	{
26
+		//
27 27
 
28
-        parent::boot();
29
-    }
28
+		parent::boot();
29
+	}
30 30
 
31
-    /**
32
-     * Define the routes for the module.
33
-     *
34
-     * @return void
35
-     */
36
-    public function map()
37
-    {
38
-        $this->mapWebRoutes();
31
+	/**
32
+	 * Define the routes for the module.
33
+	 *
34
+	 * @return void
35
+	 */
36
+	public function map()
37
+	{
38
+		$this->mapWebRoutes();
39 39
 
40
-        $this->mapApiRoutes();
40
+		$this->mapApiRoutes();
41 41
 
42
-        //
43
-    }
42
+		//
43
+	}
44 44
 
45
-    /**
46
-     * Define the "web" routes for the module.
47
-     *
48
-     * These routes all receive session state, CSRF protection, etc.
49
-     *
50
-     * @return void
51
-     */
52
-    protected function mapWebRoutes()
53
-    {
54
-        Route::group([
55
-            'middleware' => 'web',
56
-            'namespace'  => $this->namespace,
57
-        ], function ($router) {
58
-            require module_path('core', 'Routes/web.php');
59
-        });
60
-    }
45
+	/**
46
+	 * Define the "web" routes for the module.
47
+	 *
48
+	 * These routes all receive session state, CSRF protection, etc.
49
+	 *
50
+	 * @return void
51
+	 */
52
+	protected function mapWebRoutes()
53
+	{
54
+		Route::group([
55
+			'middleware' => 'web',
56
+			'namespace'  => $this->namespace,
57
+		], function ($router) {
58
+			require module_path('core', 'Routes/web.php');
59
+		});
60
+	}
61 61
 
62
-    /**
63
-     * Define the "api" routes for the module.
64
-     *
65
-     * These routes are typically stateless.
66
-     *
67
-     * @return void
68
-     */
69
-    protected function mapApiRoutes()
70
-    {
71
-        Route::group([
72
-            'middleware' => 'api',
73
-            'namespace'  => $this->namespace,
74
-            'prefix'     => 'api',
75
-        ], function ($router) {
76
-            require module_path('core', 'Routes/api.php');
77
-        });
78
-    }
62
+	/**
63
+	 * Define the "api" routes for the module.
64
+	 *
65
+	 * These routes are typically stateless.
66
+	 *
67
+	 * @return void
68
+	 */
69
+	protected function mapApiRoutes()
70
+	{
71
+		Route::group([
72
+			'middleware' => 'api',
73
+			'namespace'  => $this->namespace,
74
+			'prefix'     => 'api',
75
+		], function ($router) {
76
+			require module_path('core', 'Routes/api.php');
77
+		});
78
+	}
79 79
 }
Please login to merge, or discard this patch.
src/Modules/V1/Reporting/Providers/RouteServiceProvider.php 1 patch
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -8,72 +8,72 @@
 block discarded – undo
8 8
 class RouteServiceProvider extends ServiceProvider
9 9
 {
10 10
 	/**
11
-     * This namespace is applied to your controller routes.
12
-     *
13
-     * In addition, it is set as the URL generator's root namespace.
14
-     *
15
-     * @var string
16
-     */
17
-    protected $namespace = 'App\Modules\V1\Reporting\Http\Controllers';
11
+	 * This namespace is applied to your controller routes.
12
+	 *
13
+	 * In addition, it is set as the URL generator's root namespace.
14
+	 *
15
+	 * @var string
16
+	 */
17
+	protected $namespace = 'App\Modules\V1\Reporting\Http\Controllers';
18 18
 
19
-    /**
20
-     * Define your route model bindings, pattern filters, etc.
21
-     *
22
-     * @return void
23
-     */
24
-    public function boot()
25
-    {
26
-        //
19
+	/**
20
+	 * Define your route model bindings, pattern filters, etc.
21
+	 *
22
+	 * @return void
23
+	 */
24
+	public function boot()
25
+	{
26
+		//
27 27
 
28
-        parent::boot();
29
-    }
28
+		parent::boot();
29
+	}
30 30
 
31
-    /**
32
-     * Define the routes for the module.
33
-     *
34
-     * @return void
35
-     */
36
-    public function map()
37
-    {
38
-        $this->mapWebRoutes();
31
+	/**
32
+	 * Define the routes for the module.
33
+	 *
34
+	 * @return void
35
+	 */
36
+	public function map()
37
+	{
38
+		$this->mapWebRoutes();
39 39
 
40
-        $this->mapApiRoutes();
40
+		$this->mapApiRoutes();
41 41
 
42
-        //
43
-    }
42
+		//
43
+	}
44 44
 
45
-    /**
46
-     * Define the "web" routes for the module.
47
-     *
48
-     * These routes all receive session state, CSRF protection, etc.
49
-     *
50
-     * @return void
51
-     */
52
-    protected function mapWebRoutes()
53
-    {
54
-        Route::group([
55
-            'middleware' => 'web',
56
-            'namespace'  => $this->namespace,
57
-        ], function ($router) {
58
-            require module_path('reporting', 'Routes/web.php');
59
-        });
60
-    }
45
+	/**
46
+	 * Define the "web" routes for the module.
47
+	 *
48
+	 * These routes all receive session state, CSRF protection, etc.
49
+	 *
50
+	 * @return void
51
+	 */
52
+	protected function mapWebRoutes()
53
+	{
54
+		Route::group([
55
+			'middleware' => 'web',
56
+			'namespace'  => $this->namespace,
57
+		], function ($router) {
58
+			require module_path('reporting', 'Routes/web.php');
59
+		});
60
+	}
61 61
 
62
-    /**
63
-     * Define the "api" routes for the module.
64
-     *
65
-     * These routes are typically stateless.
66
-     *
67
-     * @return void
68
-     */
69
-    protected function mapApiRoutes()
70
-    {
71
-        Route::group([
72
-            'middleware' => 'api',
73
-            'namespace'  => $this->namespace,
74
-            'prefix'     => 'api',
75
-        ], function ($router) {
76
-            require module_path('reporting', 'Routes/api.php');
77
-        });
78
-    }
62
+	/**
63
+	 * Define the "api" routes for the module.
64
+	 *
65
+	 * These routes are typically stateless.
66
+	 *
67
+	 * @return void
68
+	 */
69
+	protected function mapApiRoutes()
70
+	{
71
+		Route::group([
72
+			'middleware' => 'api',
73
+			'namespace'  => $this->namespace,
74
+			'prefix'     => 'api',
75
+		], function ($router) {
76
+			require module_path('reporting', 'Routes/api.php');
77
+		});
78
+	}
79 79
 }
Please login to merge, or discard this patch.
src/Modules/V1/Acl/Providers/RouteServiceProvider.php 1 patch
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -8,72 +8,72 @@
 block discarded – undo
8 8
 class RouteServiceProvider extends ServiceProvider
9 9
 {
10 10
 	/**
11
-     * This namespace is applied to your controller routes.
12
-     *
13
-     * In addition, it is set as the URL generator's root namespace.
14
-     *
15
-     * @var string
16
-     */
17
-    protected $namespace = 'App\Modules\V1\Acl\Http\Controllers';
11
+	 * This namespace is applied to your controller routes.
12
+	 *
13
+	 * In addition, it is set as the URL generator's root namespace.
14
+	 *
15
+	 * @var string
16
+	 */
17
+	protected $namespace = 'App\Modules\V1\Acl\Http\Controllers';
18 18
 
19
-    /**
20
-     * Define your route model bindings, pattern filters, etc.
21
-     *
22
-     * @return void
23
-     */
24
-    public function boot()
25
-    {
26
-        //
19
+	/**
20
+	 * Define your route model bindings, pattern filters, etc.
21
+	 *
22
+	 * @return void
23
+	 */
24
+	public function boot()
25
+	{
26
+		//
27 27
 
28
-        parent::boot();
29
-    }
28
+		parent::boot();
29
+	}
30 30
 
31
-    /**
32
-     * Define the routes for the module.
33
-     *
34
-     * @return void
35
-     */
36
-    public function map()
37
-    {
38
-        $this->mapWebRoutes();
31
+	/**
32
+	 * Define the routes for the module.
33
+	 *
34
+	 * @return void
35
+	 */
36
+	public function map()
37
+	{
38
+		$this->mapWebRoutes();
39 39
 
40
-        $this->mapApiRoutes();
40
+		$this->mapApiRoutes();
41 41
 
42
-        //
43
-    }
42
+		//
43
+	}
44 44
 
45
-    /**
46
-     * Define the "web" routes for the module.
47
-     *
48
-     * These routes all receive session state, CSRF protection, etc.
49
-     *
50
-     * @return void
51
-     */
52
-    protected function mapWebRoutes()
53
-    {
54
-        Route::group([
55
-            'middleware' => 'web',
56
-            'namespace'  => $this->namespace,
57
-        ], function ($router) {
58
-            require module_path('acl', 'Routes/web.php');
59
-        });
60
-    }
45
+	/**
46
+	 * Define the "web" routes for the module.
47
+	 *
48
+	 * These routes all receive session state, CSRF protection, etc.
49
+	 *
50
+	 * @return void
51
+	 */
52
+	protected function mapWebRoutes()
53
+	{
54
+		Route::group([
55
+			'middleware' => 'web',
56
+			'namespace'  => $this->namespace,
57
+		], function ($router) {
58
+			require module_path('acl', 'Routes/web.php');
59
+		});
60
+	}
61 61
 
62
-    /**
63
-     * Define the "api" routes for the module.
64
-     *
65
-     * These routes are typically stateless.
66
-     *
67
-     * @return void
68
-     */
69
-    protected function mapApiRoutes()
70
-    {
71
-        Route::group([
72
-            'middleware' => 'api',
73
-            'namespace'  => $this->namespace,
74
-            'prefix'     => 'api',
75
-        ], function ($router) {
76
-            require module_path('acl', 'Routes/api.php');
77
-        });
78
-    }
62
+	/**
63
+	 * Define the "api" routes for the module.
64
+	 *
65
+	 * These routes are typically stateless.
66
+	 *
67
+	 * @return void
68
+	 */
69
+	protected function mapApiRoutes()
70
+	{
71
+		Route::group([
72
+			'middleware' => 'api',
73
+			'namespace'  => $this->namespace,
74
+			'prefix'     => 'api',
75
+		], function ($router) {
76
+			require module_path('acl', 'Routes/api.php');
77
+		});
78
+	}
79 79
 }
Please login to merge, or discard this patch.
Modules/V1/Acl/Database/Migrations/2015_12_20_124154_password_resets.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -5,27 +5,27 @@
 block discarded – undo
5 5
 
6 6
 class PasswordResets extends Migration
7 7
 {
8
-    /**
9
-     * Run the migrations.
10
-     *
11
-     * @return void
12
-     */
13
-    public function up()
14
-    {
15
-        Schema::create('password_resets', function (Blueprint $table) {
16
-            $table->string('email')->index();
17
-            $table->string('token')->index();
18
-            $table->timestamp('created_at');
19
-        });
20
-    }
8
+	/**
9
+	 * Run the migrations.
10
+	 *
11
+	 * @return void
12
+	 */
13
+	public function up()
14
+	{
15
+		Schema::create('password_resets', function (Blueprint $table) {
16
+			$table->string('email')->index();
17
+			$table->string('token')->index();
18
+			$table->timestamp('created_at');
19
+		});
20
+	}
21 21
 
22
-    /**
23
-     * Reverse the migrations.
24
-     *
25
-     * @return void
26
-     */
27
-    public function down()
28
-    {
29
-        Schema::dropIfExists('password_resets');
30
-    }
22
+	/**
23
+	 * Reverse the migrations.
24
+	 *
25
+	 * @return void
26
+	 */
27
+	public function down()
28
+	{
29
+		Schema::dropIfExists('password_resets');
30
+	}
31 31
 }
Please login to merge, or discard this patch.
src/Modules/V1/Acl/Database/Migrations/2015_12_20_124153_users.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -13,16 +13,16 @@
 block discarded – undo
13 13
 	public function up()
14 14
 	{
15 15
 		Schema::create('users', function (Blueprint $table) {
16
-            $table->increments('id');
17
-            $table->string('name', 100)->nullable();
18
-            $table->string('email')->unique();
19
-            $table->string('password', 60)->nullable();
20
-            $table->boolean('blocked')->default(0);
16
+			$table->increments('id');
17
+			$table->string('name', 100)->nullable();
18
+			$table->string('email')->unique();
19
+			$table->string('password', 60)->nullable();
20
+			$table->boolean('blocked')->default(0);
21 21
 			$table->date('last_change_password')->nullable();
22
-            $table->softDeletes();
23
-            $table->rememberToken();
24
-            $table->timestamps();
25
-        });
22
+			$table->softDeletes();
23
+			$table->rememberToken();
24
+			$table->timestamps();
25
+		});
26 26
 	}
27 27
 
28 28
 	/**
Please login to merge, or discard this patch.
src/lang/en/notifications.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@
 block discarded – undo
2 2
 
3 3
 return [
4 4
     
5
-    /**
6
-     * Here goes your notification messages.
7
-     */
5
+	/**
6
+	 * Here goes your notification messages.
7
+	 */
8 8
 
9 9
 ];
10 10
\ No newline at end of file
Please login to merge, or discard this patch.
src/Modules/V1/Acl/Repositories/GroupRepository.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,6 +29,6 @@
 block discarded – undo
29 29
 			$group->permissions()->attach($permissionIds);
30 30
 		});
31 31
 
32
-        return $this->find($groupId);
32
+		return $this->find($groupId);
33 33
 	}
34 34
 }
Please login to merge, or discard this patch.
src/Modules/V1/Reporting/Repositories/ReportRepository.php 1 patch
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -4,66 +4,66 @@
 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
-     * @return object
26
-     */
27
-    public function getReport($reportName, $conditions = false, $perPage = 0, $relations = [])
28
-    {
29
-        /**
30
-         * Fetch the report from db.
31
-         */
32
-        $reportConditions = $this->constructConditions(['report_name' => $reportName], $this->model);
33
-        $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
+	 * @return object
26
+	 */
27
+	public function getReport($reportName, $conditions = false, $perPage = 0, $relations = [])
28
+	{
29
+		/**
30
+		 * Fetch the report from db.
31
+		 */
32
+		$reportConditions = $this->constructConditions(['report_name' => $reportName], $this->model);
33
+		$report           = call_user_func_array("{$this->getModel()}::with", array($relations))->whereRaw($reportConditions['conditionString'], $reportConditions['conditionValues'])->first();
34 34
         
35
-        /**
36
-         * Check report existance and permission.
37
-         */
38
-        if ( ! $report) 
39
-        {
40
-            \ErrorHandler::notFound('report');
41
-        }
42
-        else if ( ! \Core::users()->can($report->view_name, 'reports'))
43
-        {
44
-            \ErrorHandler::noPermissions();
45
-        }
35
+		/**
36
+		 * Check report existance and permission.
37
+		 */
38
+		if ( ! $report) 
39
+		{
40
+			\ErrorHandler::notFound('report');
41
+		}
42
+		else if ( ! \Core::users()->can($report->view_name, 'reports'))
43
+		{
44
+			\ErrorHandler::noPermissions();
45
+		}
46 46
 
47
-        /**
48
-         * Fetch data from the report based on the given conditions.
49
-         */
50
-        $report = \DB::table($report->view_name);
51
-        unset($conditions['page']);
52
-        if (count($conditions))
53
-        {
54
-            $conditions = $this->constructConditions($conditions, $this->model);
55
-            $report->whereRaw($conditions['conditionString'], $conditions['conditionValues']);   
56
-        }
57
-        /**
58
-         * Paginate or all data.
59
-         */
60
-        if ($perPage) 
61
-        {
62
-            return $report->paginate($perPage);
63
-        }
64
-        else
65
-        {
66
-            return $report->get();  
67
-        }
68
-    }
47
+		/**
48
+		 * Fetch data from the report based on the given conditions.
49
+		 */
50
+		$report = \DB::table($report->view_name);
51
+		unset($conditions['page']);
52
+		if (count($conditions))
53
+		{
54
+			$conditions = $this->constructConditions($conditions, $this->model);
55
+			$report->whereRaw($conditions['conditionString'], $conditions['conditionValues']);   
56
+		}
57
+		/**
58
+		 * Paginate or all data.
59
+		 */
60
+		if ($perPage) 
61
+		{
62
+			return $report->paginate($perPage);
63
+		}
64
+		else
65
+		{
66
+			return $report->get();  
67
+		}
68
+	}
69 69
 }
Please login to merge, or discard this patch.
src/Modules/V1/Core/AbstractRepositories/AbstractRepositoryContainer.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -4,39 +4,39 @@
 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
-     */
17
-    public function __call($name, $arguments)
18
-    {
19
-        foreach ($this->getRepoNameSpace() as $repoNameSpace) 
20
-        {
21
-            $class = rtrim($repoNameSpace, '\\') . '\\' . ucfirst(str_singular($name)) . 'Repository';
22
-            if (class_exists($class)) 
23
-            {
24
-                \App::singleton($class, function ($app) use ($class) {
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
+	public function __call($name, $arguments)
18
+	{
19
+		foreach ($this->getRepoNameSpace() as $repoNameSpace) 
20
+		{
21
+			$class = rtrim($repoNameSpace, '\\') . '\\' . ucfirst(str_singular($name)) . 'Repository';
22
+			if (class_exists($class)) 
23
+			{
24
+				\App::singleton($class, function ($app) use ($class) {
25 25
 
26
-                    return new \App\Modules\V1\Core\Decorators\CachingDecorator(new $class, $app['cache.store']);
27
-                });
26
+					return new \App\Modules\V1\Core\Decorators\CachingDecorator(new $class, $app['cache.store']);
27
+				});
28 28
 
29
-                return \App::make($class);
30
-            }
31
-        }
32
-    }
29
+				return \App::make($class);
30
+			}
31
+		}
32
+	}
33 33
 
34
-     /**
35
-     * Abstract methods that return the necessary 
36
-     * information (repositories namespaces)
37
-     * needed to preform the previous actions.
38
-     * 
39
-     * @return array
40
-     */
41
-    abstract protected function getRepoNameSpace();
34
+	 /**
35
+	  * Abstract methods that return the necessary 
36
+	  * information (repositories namespaces)
37
+	  * needed to preform the previous actions.
38
+	  * 
39
+	  * @return array
40
+	  */
41
+	abstract protected function getRepoNameSpace();
42 42
 }
43 43
\ No newline at end of file
Please login to merge, or discard this patch.