Passed
Push — master ( 89ce1c...15034a )
by Ferry
03:13
created
src/database/migrations/2016_08_07_152421_add_role_users.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
      */
13 13
     public function up()
14 14
     {
15
-        Schema::table('users', function (Blueprint $table) {
15
+        Schema::table('users', function(Blueprint $table) {
16 16
             $table->string('photo')->nullable();
17 17
             $table->integer('cb_roles_id');
18 18
         });
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function down()
27 27
     {
28
-        Schema::table('users', function (Blueprint $table) {
28
+        Schema::table('users', function(Blueprint $table) {
29 29
             $table->dropColumn('cb_roles_id');
30 30
             $table->dropColumn('photo');
31 31
         });
Please login to merge, or discard this patch.
src/fonts/Fontawesome.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 namespace crocodicstudio\crudbooster\fonts;
3 3
 
4 4
 class Fontawesome {
5
-	public static function getIcons() {
6
-		return [
5
+    public static function getIcons() {
6
+        return [
7 7
             "glass",
8 8
             "music",
9 9
             "search",
@@ -699,5 +699,5 @@  discard block
 block discarded – undo
699 699
             "bluetooth-b",
700 700
             "percent",
701 701
         ];
702
-	}
702
+    }
703 703
 }
704 704
\ No newline at end of file
Please login to merge, or discard this patch.
src/hooks/CBHook.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 interface CBHook {
5 5
 
6 6
     public function hookGetLogin();
7
-	public function hookPostLogin();
8
-	public function beforeBackendMiddleware($request);
7
+    public function hookPostLogin();
8
+    public function beforeBackendMiddleware($request);
9 9
     public function afterBackendMiddleware($request, $response);
10 10
 }
11 11
\ No newline at end of file
Please login to merge, or discard this patch.
src/database/migrations/2016_08_07_152421_table_role_privileges.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
      */
13 13
     public function up()
14 14
     {
15
-        Schema::create('cb_role_privileges', function (Blueprint $table) {
15
+        Schema::create('cb_role_privileges', function(Blueprint $table) {
16 16
             $table->increments("id");
17 17
             $table->integer("cb_roles_id");
18 18
             $table->integer("cb_menus_id");
Please login to merge, or discard this patch.
src/database/migrations/2016_08_07_152421_table_roles.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
      */
13 13
     public function up()
14 14
     {
15
-        Schema::create('cb_roles', function (Blueprint $table) {
15
+        Schema::create('cb_roles', function(Blueprint $table) {
16 16
             $table->increments("id");
17 17
             $table->string('name');
18 18
         });
Please login to merge, or discard this patch.
src/database/migrations/2016_08_07_152421_table_modules.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
      */
13 13
     public function up()
14 14
     {
15
-        Schema::create('cb_modules', function (Blueprint $table) {
15
+        Schema::create('cb_modules', function(Blueprint $table) {
16 16
             $table->increments("id");
17 17
             $table->string('name');
18 18
             $table->string("icon");
Please login to merge, or discard this patch.
src/routes.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
     if (Request::is(cbConfig('ADMIN_PATH'))) {
52 52
         if($dashboard = cbConfig("ADMIN_DASHBOARD_CONTROLLER")) {
53 53
             cb()->routeGet("/", $dashboard);
54
-        }else{
54
+        } else{
55 55
             cb()->routeGet("/", "\crocodicstudio\crudbooster\controllers\AdminDashboardController@getIndex");
56 56
         }
57 57
     }
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,40 +1,40 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Developer Backend Middleware
4
-Route::group(['middleware' => ['web',\crocodicstudio\crudbooster\middlewares\CBDeveloper::class],
4
+Route::group(['middleware' => ['web', \crocodicstudio\crudbooster\middlewares\CBDeveloper::class],
5 5
     'prefix'=>cbConfig('DEV_PATH'),
6
-    'namespace' => 'crocodicstudio\crudbooster\controllers'], function () {
7
-    cb()->routeController("modules", "DeveloperModulesController",'crocodicstudio\crudbooster\controllers');
8
-    cb()->routeController("menus", "DeveloperMenusController",'crocodicstudio\crudbooster\controllers');
9
-    cb()->routeController("roles","DeveloperRolesController",'crocodicstudio\crudbooster\controllers');
10
-    cb()->routeController("users","DeveloperUsersController",'crocodicstudio\crudbooster\controllers');
11
-    cb()->routeGet("/","DeveloperDashboardController@getIndex");
6
+    'namespace' => 'crocodicstudio\crudbooster\controllers'], function() {
7
+    cb()->routeController("modules", "DeveloperModulesController", 'crocodicstudio\crudbooster\controllers');
8
+    cb()->routeController("menus", "DeveloperMenusController", 'crocodicstudio\crudbooster\controllers');
9
+    cb()->routeController("roles", "DeveloperRolesController", 'crocodicstudio\crudbooster\controllers');
10
+    cb()->routeController("users", "DeveloperUsersController", 'crocodicstudio\crudbooster\controllers');
11
+    cb()->routeGet("/", "DeveloperDashboardController@getIndex");
12 12
 });
13 13
 
14 14
 // Developer Auth Middleware
15 15
 Route::group(['middleware' => ['web'],
16 16
     'prefix'=>cbConfig('DEV_PATH'),
17
-    'namespace' => 'crocodicstudio\crudbooster\controllers'], function () {
18
-    cb()->routePost("login","AdminAuthController@postLoginDeveloper");
19
-    cb()->routeGet("login","AdminAuthController@getLoginDeveloper");
20
-    cb()->routeGet("logout","AdminAuthController@getLogoutDeveloper");
17
+    'namespace' => 'crocodicstudio\crudbooster\controllers'], function() {
18
+    cb()->routePost("login", "AdminAuthController@postLoginDeveloper");
19
+    cb()->routeGet("login", "AdminAuthController@getLoginDeveloper");
20
+    cb()->routeGet("logout", "AdminAuthController@getLogoutDeveloper");
21 21
 });
22 22
 
23 23
 // Routing without any middleware
24
-Route::group(['middleware' => ['web'], 'namespace' => '\crocodicstudio\crudbooster\controllers'], function () {
24
+Route::group(['middleware' => ['web'], 'namespace' => '\crocodicstudio\crudbooster\controllers'], function() {
25 25
     cb()->routeGet('uploads/{one?}/{two?}/{three?}/{four?}/{five?}', "FileController@getPreview");
26 26
 });
27 27
 
28 28
 // Routing without any middleware with admin prefix
29
-Route::group(['middleware' => ['web'], 'prefix' => cbConfig('ADMIN_PATH'), 'namespace' => 'crocodicstudio\crudbooster\controllers'], function () {
29
+Route::group(['middleware' => ['web'], 'prefix' => cbConfig('ADMIN_PATH'), 'namespace' => 'crocodicstudio\crudbooster\controllers'], function() {
30 30
     cb()->routeGet('logout', "AdminAuthController@getLogout");
31 31
     cb()->routePost('login', "AdminAuthController@postLogin");
32 32
     cb()->routeGet('login', "AdminAuthController@getLogin");
33 33
 });
34 34
 
35 35
 // Routing package controllers
36
-cb()->routeGroupBackend(function () {
37
-    cb()->routeController('profile', 'AdminProfileController','crocodicstudio\crudbooster\controllers');
36
+cb()->routeGroupBackend(function() {
37
+    cb()->routeController('profile', 'AdminProfileController', 'crocodicstudio\crudbooster\controllers');
38 38
 });
39 39
 
40 40
 // Auto Routing for App\Http\Controllers
@@ -42,24 +42,24 @@  discard block
 block discarded – undo
42 42
     'middleware' => ['web', \crocodicstudio\crudbooster\middlewares\CBBackend::class],
43 43
     'prefix' => cbConfig('ADMIN_PATH'),
44 44
     'namespace' => 'App\Http\Controllers',
45
-], function () {
45
+], function() {
46 46
 
47 47
     if (Request::is(cbConfig('ADMIN_PATH'))) {
48
-        if($dashboard = cbConfig("ADMIN_DASHBOARD_CONTROLLER")) {
48
+        if ($dashboard = cbConfig("ADMIN_DASHBOARD_CONTROLLER")) {
49 49
             cb()->routeGet("/", $dashboard);
50
-        }else{
50
+        } else {
51 51
             cb()->routeGet("/", "\crocodicstudio\crudbooster\controllers\AdminDashboardController@getIndex");
52 52
         }
53 53
     }
54 54
 
55 55
     $controllers = glob(app_path('Http/Controllers/Admin*Controller.php'));
56 56
 
57
-    foreach($controllers as $controller) {
57
+    foreach ($controllers as $controller) {
58 58
         $controllerName = basename($controller);
59
-        $controllerName = rtrim($controllerName,".php");
59
+        $controllerName = rtrim($controllerName, ".php");
60 60
         $className = '\App\Http\Controllers\\'.$controllerName;
61 61
         $controllerClass = new $className();
62
-        if(method_exists($controllerClass, 'cbInit')) {
62
+        if (method_exists($controllerClass, 'cbInit')) {
63 63
             cb()->routeController($controllerClass->getData('permalink'), $controllerName);
64 64
         }
65 65
     }
Please login to merge, or discard this patch.
src/views/module/form/form_body.blade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 @endforeach
11 11
 
12 12
 <?php
13
-    if(cb()->getCurrentMethod()=="getEdit") {
13
+    if (cb()->getCurrentMethod() == "getEdit") {
14 14
         /** @var $row object */
15 15
         columnSingleton()->valueAssignment($row);
16 16
     }
Please login to merge, or discard this patch.
src/controllers/DeveloperUsersController.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
     public function getIndex() {
28 28
         $data = [];
29 29
         $data['result'] = DB::table("users")
30
-            ->join("cb_roles","cb_roles.id","=","cb_roles_id")
31
-            ->select("users.*","cb_roles.name as cb_roles_name")
30
+            ->join("cb_roles", "cb_roles.id", "=", "cb_roles_id")
31
+            ->select("users.*", "cb_roles.name as cb_roles_name")
32 32
             ->get();
33
-        return view($this->view.'.index',$data);
33
+        return view($this->view.'.index', $data);
34 34
     }
35 35
 
36 36
     public function getAdd() {
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
     public function postAddSave() {
43 43
         try {
44
-            cb()->validation(['name', 'email','password','cb_roles_id']);
44
+            cb()->validation(['name', 'email', 'password', 'cb_roles_id']);
45 45
 
46 46
             $user = [];
47 47
             $user['name'] = request('name');
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             $user['cb_roles_id'] = request('cb_roles_id');
51 51
             DB::table('users')->insert($user);
52 52
 
53
-            return cb()->redirect(route("DeveloperUsersControllerGetIndex"),"New user has been created!","success");
53
+            return cb()->redirect(route("DeveloperUsersControllerGetIndex"), "New user has been created!", "success");
54 54
 
55 55
         } catch (CBValidationException $e) {
56 56
             return cb()->redirectBack($e->getMessage());
@@ -66,16 +66,16 @@  discard block
 block discarded – undo
66 66
 
67 67
     public function postEditSave($id) {
68 68
         try {
69
-            cb()->validation(['name', 'email','cb_roles_id']);
69
+            cb()->validation(['name', 'email', 'cb_roles_id']);
70 70
 
71 71
             $user = [];
72 72
             $user['name'] = request('name');
73 73
             $user['email'] = request('email');
74
-            if(request('password')) $user['password'] = Hash::make(request('password'));
74
+            if (request('password')) $user['password'] = Hash::make(request('password'));
75 75
             $user['cb_roles_id'] = request('cb_roles_id');
76
-            DB::table('users')->where('id',$id)->update($user);
76
+            DB::table('users')->where('id', $id)->update($user);
77 77
 
78
-            return cb()->redirect(route("DeveloperUsersControllerGetIndex"),"The user has been updated!","success");
78
+            return cb()->redirect(route("DeveloperUsersControllerGetIndex"), "The user has been updated!", "success");
79 79
 
80 80
         } catch (CBValidationException $e) {
81 81
             return cb()->redirectBack($e->getMessage());
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
     }
84 84
 
85 85
     public function getDelete($id) {
86
-        DB::table("users")->where("id",$id)->delete();
87
-        return cb()->redirectBack("The user has been deleted!","success");
86
+        DB::table("users")->where("id", $id)->delete();
87
+        return cb()->redirectBack("The user has been deleted!", "success");
88 88
     }
89 89
 
90 90
 }
91 91
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,9 @@
 block discarded – undo
71 71
             $user = [];
72 72
             $user['name'] = request('name');
73 73
             $user['email'] = request('email');
74
-            if(request('password')) $user['password'] = Hash::make(request('password'));
74
+            if(request('password')) {
75
+                $user['password'] = Hash::make(request('password'));
76
+            }
75 77
             $user['cb_roles_id'] = request('cb_roles_id');
76 78
             DB::table('users')->where('id',$id)->update($user);
77 79
 
Please login to merge, or discard this patch.