Passed
Push — master ( 3be567...10f746 )
by Ferry
03:51
created
src/helpers/ModuleGenerator.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -41,12 +41,12 @@  discard block
 block discarded – undo
41 41
     }
42 42
 
43 43
     public function make() {
44
-        $name = ($this->name)?:ucwords(str_replace("_"," ",$this->table));
44
+        $name = ($this->name) ?: ucwords(str_replace("_", " ", $this->table));
45 45
 
46 46
         $template = file_get_contents(__DIR__."/../templates/FooBarController.stub");
47 47
 
48 48
         //Replace table
49
-        $template = str_replace("{table}",'"'.$this->table.'"', $template);
49
+        $template = str_replace("{table}", '"'.$this->table.'"', $template);
50 50
 
51 51
         //Replace permalink
52 52
         $template = str_replace("{permalink}", '"'.$this->table.'"', $template);
@@ -57,13 +57,13 @@  discard block
 block discarded – undo
57 57
         //Replace scaffolding
58 58
         $fields = DB::getSchemaBuilder()->getColumnListing($this->table);
59 59
         $primaryKey = cb()->findPrimaryKey($this->table);
60
-        $exceptions = [$primaryKey,'created_at','updated_at'];
60
+        $exceptions = [$primaryKey, 'created_at', 'updated_at'];
61 61
         $scaffold = "";
62
-        foreach($fields as $field) {
62
+        foreach ($fields as $field) {
63 63
 
64
-            if(in_array($field, $exceptions)) continue;
64
+            if (in_array($field, $exceptions)) continue;
65 65
 
66
-            $fielLabel = ucwords(str_replace("_"," ",$field));
66
+            $fielLabel = ucwords(str_replace("_", " ", $field));
67 67
             $scaffold .= '$this->addText("'.$fielLabel.'");'."\n\t\t";
68 68
         }
69 69
         $template = str_replace("{scaffolding}", $scaffold, $template);
Please login to merge, or discard this patch.
src/views/dev_layouts/modules/menus/form.blade.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -149,21 +149,21 @@
 block discarded – undo
149 149
                     <?php
150 150
                     $font = new \crocodicstudio\crudbooster\helpers\FontAwesome();
151 151
                     $fontData = [
152
-                        ["data"=>$font->text(),"label"=>"Text"],
153
-                        ["data"=>$font->web(),"label"=>"Web"],
154
-                        ["data"=>$font->video(),"label"=>"Video"],
155
-                        ["data"=>$font->transportation(),"label"=>"Transportation"],
156
-                        ["data"=>$font->payment(),"label"=>"Payment"],
157
-                        ["data"=>$font->medical(),"label"=>"Medical"],
158
-                        ["data"=>$font->hand(),"label"=>"Hand"],
159
-                        ["data"=>$font->fileType(),"label"=>"File Type"],
160
-                        ["data"=>$font->directional(),"label"=>"Directional"],
161
-                        ["data"=>$font->currency(),"label"=>"Currency"],
162
-                        ["data"=>$font->chart(),"label"=>"Chart"],
163
-                        ["data"=>$font->brands(),"label"=>"Brand"],
164
-                        ["data"=>$font->gender(),"label"=>"Gender"],
165
-                        ["data"=>$font->form(),"label"=>"Form"],
166
-                        ["data"=>$font->spinner(),"label"=>"Spinner"]
152
+                        ["data"=>$font->text(), "label"=>"Text"],
153
+                        ["data"=>$font->web(), "label"=>"Web"],
154
+                        ["data"=>$font->video(), "label"=>"Video"],
155
+                        ["data"=>$font->transportation(), "label"=>"Transportation"],
156
+                        ["data"=>$font->payment(), "label"=>"Payment"],
157
+                        ["data"=>$font->medical(), "label"=>"Medical"],
158
+                        ["data"=>$font->hand(), "label"=>"Hand"],
159
+                        ["data"=>$font->fileType(), "label"=>"File Type"],
160
+                        ["data"=>$font->directional(), "label"=>"Directional"],
161
+                        ["data"=>$font->currency(), "label"=>"Currency"],
162
+                        ["data"=>$font->chart(), "label"=>"Chart"],
163
+                        ["data"=>$font->brands(), "label"=>"Brand"],
164
+                        ["data"=>$font->gender(), "label"=>"Gender"],
165
+                        ["data"=>$font->form(), "label"=>"Form"],
166
+                        ["data"=>$font->spinner(), "label"=>"Spinner"]
167 167
                     ];
168 168
                     ?>
169 169
                     @foreach($fontData as $f)
Please login to merge, or discard this patch.
assets/adminlte/bower_components/ckeditor/samples/old/assets/posteddata.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,18 +27,18 @@
 block discarded – undo
27 27
 
28 28
 if (!empty($_POST))
29 29
 {
30
-	foreach ( $_POST as $key => $value )
30
+	foreach ($_POST as $key => $value)
31 31
 	{
32
-		if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) )
32
+		if ((!is_string($value) && !is_numeric($value)) || !is_string($key))
33 33
 			continue;
34 34
 
35
-		if ( get_magic_quotes_gpc() )
36
-			$value = htmlspecialchars( stripslashes((string)$value) );
35
+		if (get_magic_quotes_gpc())
36
+			$value = htmlspecialchars(stripslashes((string) $value));
37 37
 		else
38
-			$value = htmlspecialchars( (string)$value );
38
+			$value = htmlspecialchars((string) $value);
39 39
 ?>
40 40
 		<tr>
41
-			<th style="vertical-align: top"><?php echo htmlspecialchars( (string)$key ); ?></th>
41
+			<th style="vertical-align: top"><?php echo htmlspecialchars((string) $key); ?></th>
42 42
 			<td><pre class="samples"><?php echo $value; ?></pre></td>
43 43
 		</tr>
44 44
 	<?php
Please login to merge, or discard this patch.
src/views/dev_layouts/modules/modules/add.blade.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -149,21 +149,21 @@
 block discarded – undo
149 149
                     <?php
150 150
                     $font = new \crocodicstudio\crudbooster\helpers\FontAwesome();
151 151
                     $fontData = [
152
-                        ["data"=>$font->text(),"label"=>"Text"],
153
-                        ["data"=>$font->web(),"label"=>"Web"],
154
-                        ["data"=>$font->video(),"label"=>"Video"],
155
-                        ["data"=>$font->transportation(),"label"=>"Transportation"],
156
-                        ["data"=>$font->payment(),"label"=>"Payment"],
157
-                        ["data"=>$font->medical(),"label"=>"Medical"],
158
-                        ["data"=>$font->hand(),"label"=>"Hand"],
159
-                        ["data"=>$font->fileType(),"label"=>"File Type"],
160
-                        ["data"=>$font->directional(),"label"=>"Directional"],
161
-                        ["data"=>$font->currency(),"label"=>"Currency"],
162
-                        ["data"=>$font->chart(),"label"=>"Chart"],
163
-                        ["data"=>$font->brands(),"label"=>"Brand"],
164
-                        ["data"=>$font->gender(),"label"=>"Gender"],
165
-                        ["data"=>$font->form(),"label"=>"Form"],
166
-                        ["data"=>$font->spinner(),"label"=>"Spinner"]
152
+                        ["data"=>$font->text(), "label"=>"Text"],
153
+                        ["data"=>$font->web(), "label"=>"Web"],
154
+                        ["data"=>$font->video(), "label"=>"Video"],
155
+                        ["data"=>$font->transportation(), "label"=>"Transportation"],
156
+                        ["data"=>$font->payment(), "label"=>"Payment"],
157
+                        ["data"=>$font->medical(), "label"=>"Medical"],
158
+                        ["data"=>$font->hand(), "label"=>"Hand"],
159
+                        ["data"=>$font->fileType(), "label"=>"File Type"],
160
+                        ["data"=>$font->directional(), "label"=>"Directional"],
161
+                        ["data"=>$font->currency(), "label"=>"Currency"],
162
+                        ["data"=>$font->chart(), "label"=>"Chart"],
163
+                        ["data"=>$font->brands(), "label"=>"Brand"],
164
+                        ["data"=>$font->gender(), "label"=>"Gender"],
165
+                        ["data"=>$font->form(), "label"=>"Form"],
166
+                        ["data"=>$font->spinner(), "label"=>"Spinner"]
167 167
                     ];
168 168
                     ?>
169 169
                     @foreach($fontData as $f)
Please login to merge, or discard this patch.
src/views/dev_layouts/modules/modules/edit.blade.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -149,21 +149,21 @@
 block discarded – undo
149 149
                     <?php
150 150
                     $font = new \crocodicstudio\crudbooster\helpers\FontAwesome();
151 151
                     $fontData = [
152
-                        ["data"=>$font->text(),"label"=>"Text"],
153
-                        ["data"=>$font->web(),"label"=>"Web"],
154
-                        ["data"=>$font->video(),"label"=>"Video"],
155
-                        ["data"=>$font->transportation(),"label"=>"Transportation"],
156
-                        ["data"=>$font->payment(),"label"=>"Payment"],
157
-                        ["data"=>$font->medical(),"label"=>"Medical"],
158
-                        ["data"=>$font->hand(),"label"=>"Hand"],
159
-                        ["data"=>$font->fileType(),"label"=>"File Type"],
160
-                        ["data"=>$font->directional(),"label"=>"Directional"],
161
-                        ["data"=>$font->currency(),"label"=>"Currency"],
162
-                        ["data"=>$font->chart(),"label"=>"Chart"],
163
-                        ["data"=>$font->brands(),"label"=>"Brand"],
164
-                        ["data"=>$font->gender(),"label"=>"Gender"],
165
-                        ["data"=>$font->form(),"label"=>"Form"],
166
-                        ["data"=>$font->spinner(),"label"=>"Spinner"]
152
+                        ["data"=>$font->text(), "label"=>"Text"],
153
+                        ["data"=>$font->web(), "label"=>"Web"],
154
+                        ["data"=>$font->video(), "label"=>"Video"],
155
+                        ["data"=>$font->transportation(), "label"=>"Transportation"],
156
+                        ["data"=>$font->payment(), "label"=>"Payment"],
157
+                        ["data"=>$font->medical(), "label"=>"Medical"],
158
+                        ["data"=>$font->hand(), "label"=>"Hand"],
159
+                        ["data"=>$font->fileType(), "label"=>"File Type"],
160
+                        ["data"=>$font->directional(), "label"=>"Directional"],
161
+                        ["data"=>$font->currency(), "label"=>"Currency"],
162
+                        ["data"=>$font->chart(), "label"=>"Chart"],
163
+                        ["data"=>$font->brands(), "label"=>"Brand"],
164
+                        ["data"=>$font->gender(), "label"=>"Gender"],
165
+                        ["data"=>$font->form(), "label"=>"Form"],
166
+                        ["data"=>$font->spinner(), "label"=>"Spinner"]
167 167
                     ];
168 168
                     ?>
169 169
                     @foreach($fontData as $f)
Please login to merge, or discard this patch.
src/configs/crudbooster.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,16 +26,16 @@
 block discarded – undo
26 26
     /*
27 27
      * For security reason we have limit the upload file formats bellow
28 28
      */
29
-    'UPLOAD_FILE_EXTENSION_ALLOWED' => ['jpg','jpeg','png','gif','pdf','xls','xlsx','doc','docx','txt','zip','rar','rtf'],
29
+    'UPLOAD_FILE_EXTENSION_ALLOWED' => ['jpg', 'jpeg', 'png', 'gif', 'pdf', 'xls', 'xlsx', 'doc', 'docx', 'txt', 'zip', 'rar', 'rtf'],
30 30
 
31
-    'UPLOAD_IMAGE_EXTENSION_ALLOWED' => ['jpg','jpeg','png','gif'],
31
+    'UPLOAD_IMAGE_EXTENSION_ALLOWED' => ['jpg', 'jpeg', 'png', 'gif'],
32 32
 
33 33
     /*
34 34
      * Data Migration table additional
35 35
      * You can define in this array what the tables you want to include in "php artisan crudbooster:data_migration"
36 36
      * The default is all cb_ prefix will be include in data migration
37 37
      */
38
-    'ADDITIONAL_DATA_MIGRATION'=>['users','migrations'],
38
+    'ADDITIONAL_DATA_MIGRATION'=>['users', 'migrations'],
39 39
 
40 40
     /*
41 41
      * Google FCM Server Key is used to send a notification via FireBase cloud message
Please login to merge, or discard this patch.
src/commands/MigrateData.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -32,13 +32,13 @@  discard block
 block discarded – undo
32 32
     public function handle()
33 33
     {
34 34
 
35
-        if($this->option("generate")) {
35
+        if ($this->option("generate")) {
36 36
             $this->info("== Generating Seeder ==");
37 37
             $this->generateSeeder();
38 38
             $this->info("== Finish ==");
39
-        }else{
39
+        } else {
40 40
             $this->info("== Importing the seeder ==");
41
-            $this->call("db:seed",["--class"=>"CbMigrationSeeder"]);
41
+            $this->call("db:seed", ["--class"=>"CbMigrationSeeder"]);
42 42
             $this->info("== Finish ==");
43 43
         }
44 44
 
@@ -50,18 +50,18 @@  discard block
 block discarded – undo
50 50
         $php_string = "";
51 51
         $additional_tables = cbConfig("ADDITIONAL_DATA_MIGRATION");
52 52
 
53
-        foreach($tables as $table) {
54
-            if(substr($table,0,3) == "cb_" || in_array($table, $additional_tables)) {
53
+        foreach ($tables as $table) {
54
+            if (substr($table, 0, 3) == "cb_" || in_array($table, $additional_tables)) {
55 55
                 $this->info("Create seeder for table : ".$table);
56 56
                 $rows = DB::table($table)->get();
57 57
                 $data = [];
58
-                foreach($rows as $i=>$row) {
58
+                foreach ($rows as $i=>$row) {
59 59
                     $data[$i] = [];
60
-                    foreach($row as $key=>$val) {
60
+                    foreach ($row as $key=>$val) {
61 61
                         $data[$i][$key] = $val;
62 62
                     }
63 63
                 }
64
-                if(count($data)!=0) {
64
+                if (count($data) != 0) {
65 65
                     $php_string .= 'DB::table(\''.$table.'\')->delete();'."\n\t\t\t";
66 66
                     $php_string .= 'DB::table(\''.$table.'\')->insert('.min_var_export($data).');'."\n\t\t\t";
67 67
                 }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         $composer_path = '';
92 92
         if (file_exists(getcwd().'/composer.phar')) {
93 93
             $composer_path = '"'.PHP_BINARY.'" '.getcwd().'/composer.phar';
94
-        }else{
94
+        } else {
95 95
             $composer_path = 'composer';
96 96
         }
97 97
 
Please login to merge, or discard this patch.
src/controllers/traits/ControllerSetting.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
29 29
         $this->setButtonDetail(true);
30 30
         $this->setButtonSave(true);
31 31
         $this->setButtonLimitPage(true);
32
-        $this->hideButtonDeleteWhen(function ($row) { return false; });
33
-        $this->hideButtonDetailWhen(function ($row) { return false; });
34
-        $this->hideButtonEditWhen(function ($row) { return false; });
35
-        $this->style(function () { return null; });
36
-        $this->javascript(function () { return null; });
32
+        $this->hideButtonDeleteWhen(function($row) { return false; });
33
+        $this->hideButtonDetailWhen(function($row) { return false; });
34
+        $this->hideButtonEditWhen(function($row) { return false; });
35
+        $this->style(function() { return null; });
36
+        $this->javascript(function() { return null; });
37 37
     }
38 38
 
39 39
     public function style(callable $style) {
@@ -137,9 +137,9 @@  discard block
 block discarded – undo
137 137
      * @param ButtonColor $color
138 138
      * @param string $attributes
139 139
      */
140
-    public function addIndexActionButton($label, $actionURL, $fontAwesome_icon=null, $color=null, $attributes = null)
140
+    public function addIndexActionButton($label, $actionURL, $fontAwesome_icon = null, $color = null, $attributes = null)
141 141
     {
142
-        $color = ($color)?:ButtonColor::DARK_BLUE;
142
+        $color = ($color) ?: ButtonColor::DARK_BLUE;
143 143
 
144 144
         $model = new IndexActionButtonModel();
145 145
         $model->setLabel($label);
@@ -194,12 +194,12 @@  discard block
 block discarded – undo
194 194
      * @param $fontAwesome_icon
195 195
      * @param ButtonColor|string $color
196 196
      */
197
-    public function addActionButton($label, $url_target, $condition_callback=null, $fontAwesome_icon=null, $color=null, $confirmation = false)
197
+    public function addActionButton($label, $url_target, $condition_callback = null, $fontAwesome_icon = null, $color = null, $confirmation = false)
198 198
     {
199 199
         $new = new AddActionButtonModel();
200 200
         $new->setLabel($label);
201
-        $new->setIcon($fontAwesome_icon?:"fa fa-bars");
202
-        $new->setColor($color?:"primary");
201
+        $new->setIcon($fontAwesome_icon ?: "fa fa-bars");
202
+        $new->setColor($color ?: "primary");
203 203
         $new->setUrl($url_target);
204 204
         $new->setCondition($condition_callback);
205 205
         $new->setConfirmation($confirmation);
Please login to merge, or discard this patch.
src/controllers/CBController.php 1 patch
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -26,14 +26,14 @@  discard block
 block discarded – undo
26 26
 
27 27
     public function __call($method, $parameters)
28 28
     {
29
-        if($method == "getData") {
29
+        if ($method == "getData") {
30 30
             $key = $parameters[0];
31
-            if(isset($this->data[$key])) {
31
+            if (isset($this->data[$key])) {
32 32
                 return $this->data[$key];
33
-            }else{
33
+            } else {
34 34
                 return null;
35 35
             }
36
-        }else{
36
+        } else {
37 37
             return null;
38 38
         }
39 39
     }
@@ -48,19 +48,19 @@  discard block
 block discarded – undo
48 48
 
49 49
         $query->addSelect($this->data['table'].'.'.cb()->pk($this->data['table']).' as primary_key');
50 50
 
51
-        if(isset($this->data['hook_query_index']) && is_callable($this->data['hook_query_index']))
51
+        if (isset($this->data['hook_query_index']) && is_callable($this->data['hook_query_index']))
52 52
         {
53 53
             $query = call_user_func($this->data['hook_query_index'], $query);
54 54
         }
55 55
 
56
-        $softDelete = isset($this->data['disable_soft_delete'])?$this->data['disable_soft_delete']:true;
57
-        if($softDelete === true && Schema::hasColumn($this->data['table'],'deleted_at')) {
56
+        $softDelete = isset($this->data['disable_soft_delete']) ? $this->data['disable_soft_delete'] : true;
57
+        if ($softDelete === true && Schema::hasColumn($this->data['table'], 'deleted_at')) {
58 58
             $query->whereNull($this->data['table'].'.deleted_at');
59 59
         }
60 60
 
61 61
 
62
-        if(isset($joins)) {
63
-            foreach($joins as $join)
62
+        if (isset($joins)) {
63
+            foreach ($joins as $join)
64 64
             {
65 65
                 $query->join($join['target_table'],
66 66
                         $join['target_table_primary'],
@@ -70,14 +70,14 @@  discard block
 block discarded – undo
70 70
             }
71 71
         }
72 72
 
73
-        foreach($columns as $column) {
73
+        foreach ($columns as $column) {
74 74
             /** @var ColumnModel $column */
75
-            if($column->getType() != "custom") {
76
-                if(strpos($column->getField(),".") === false) {
77
-                    if(Schema::hasColumn($this->data['table'], $column->getField())) {
75
+            if ($column->getType() != "custom") {
76
+                if (strpos($column->getField(), ".") === false) {
77
+                    if (Schema::hasColumn($this->data['table'], $column->getField())) {
78 78
                         $query->addSelect($this->data['table'].'.'.$column->getField());
79 79
                     }
80
-                }else{
80
+                } else {
81 81
                     $query->addSelect($column->getField());
82 82
                 }
83 83
             }
@@ -85,20 +85,20 @@  discard block
 block discarded – undo
85 85
             $query = getTypeHook($column->getType())->query($query, $column);
86 86
         }
87 87
 
88
-        if(request()->has('q'))
88
+        if (request()->has('q'))
89 89
         {
90
-            if(isset($this->data['hook_search_query'])) {
90
+            if (isset($this->data['hook_search_query'])) {
91 91
                 $query = call_user_func($this->data['hook_search_query'], $query);
92
-            }else{
93
-                $query->where(function ($where) use ($columns) {
92
+            } else {
93
+                $query->where(function($where) use ($columns) {
94 94
                     /**
95 95
                      * @var $where Builder
96 96
                      */
97
-                    foreach($columns as $column)
97
+                    foreach ($columns as $column)
98 98
                     {
99
-                        if(strpos($column->getField(),".") === false) {
99
+                        if (strpos($column->getField(), ".") === false) {
100 100
                             $field = $this->data['table'].'.'.$column->getField();
101
-                        }else{
101
+                        } else {
102 102
                             $field = $column->getField();
103 103
                         }
104 104
                         $where->orWhere($field, 'like', '%'.request('q').'%');
@@ -107,17 +107,17 @@  discard block
 block discarded – undo
107 107
             }
108 108
         }
109 109
 
110
-        if(isset($this->data['hook_query_index']) && is_callable($this->data['hook_query_index'])) {
110
+        if (isset($this->data['hook_query_index']) && is_callable($this->data['hook_query_index'])) {
111 111
             $query = call_user_func($this->data['hook_query_index'], $query);
112 112
         }
113 113
 
114 114
 
115
-        if(request()->has(['order_by','order_sort']))
115
+        if (request()->has(['order_by', 'order_sort']))
116 116
         {
117
-            if(in_array(request('order_by'),columnSingleton()->getColumnNameOnly())) {
117
+            if (in_array(request('order_by'), columnSingleton()->getColumnNameOnly())) {
118 118
                 $query->orderBy(request('order_by'), request('order_sort'));
119 119
             }
120
-        }else{
120
+        } else {
121 121
             $query->orderBy($this->data['table'].'.'.cb()->findPrimaryKey($this->data['table']), "desc");
122 122
         }
123 123
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
     public function getIndex()
128 128
     {
129
-        if(!module()->canBrowse()) return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area");
129
+        if (!module()->canBrowse()) return cb()->redirect(cb()->getAdminUrl(), "You do not have a privilege access to this area");
130 130
 
131 131
         $query = $this->repository();
132 132
         $result = $query->paginate(20);
@@ -141,29 +141,29 @@  discard block
 block discarded – undo
141 141
      */
142 142
     private function validation()
143 143
     {
144
-        if(isset($this->data['validation'])) {
144
+        if (isset($this->data['validation'])) {
145 145
             $validator = Validator::make(request()->all(), @$this->data['validation'], @$this->data['validation_messages']);
146 146
             if ($validator->fails()) {
147 147
                 $message = $validator->messages();
148 148
                 $message_all = $message->all();
149
-                throw new CBValidationException(implode(', ',$message_all));
149
+                throw new CBValidationException(implode(', ', $message_all));
150 150
             }
151 151
         }
152 152
     }
153 153
 
154 154
     public function getAdd()
155 155
     {
156
-        if(!module()->canCreate()) return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area");
156
+        if (!module()->canCreate()) return cb()->redirect(cb()->getAdminUrl(), "You do not have a privilege access to this area");
157 157
 
158 158
         $data = [];
159 159
         $data['page_title'] = $this->data['page_title'].' : Add';
160 160
         $data['action_url'] = module()->addSaveURL();
161
-        return view('crudbooster::module.form.form',array_merge($data, $this->data));
161
+        return view('crudbooster::module.form.form', array_merge($data, $this->data));
162 162
     }
163 163
 
164 164
     public function postAddSave()
165 165
     {
166
-        if(!module()->canCreate()) return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area");
166
+        if (!module()->canCreate()) return cb()->redirect(cb()->getAdminUrl(), "You do not have a privilege access to this area");
167 167
 
168 168
         try {
169 169
             $this->validation();
@@ -171,28 +171,28 @@  discard block
 block discarded – undo
171 171
             $data = columnSingleton()->getAssignmentData();
172 172
 
173 173
             //Clear data from Primary Key
174
-            unset($data[ cb()->pk($this->data['table']) ]);
174
+            unset($data[cb()->pk($this->data['table'])]);
175 175
 
176
-            if(Schema::hasColumn($this->data['table'], 'created_at')) {
176
+            if (Schema::hasColumn($this->data['table'], 'created_at')) {
177 177
                 $data['created_at'] = date('Y-m-d H:i:s');
178 178
             }
179 179
 
180
-            if(isset($this->data['hook_before_insert']) && is_callable($this->data['hook_before_insert'])) {
180
+            if (isset($this->data['hook_before_insert']) && is_callable($this->data['hook_before_insert'])) {
181 181
                 $data = call_user_func($this->data['hook_before_insert'], $data);
182 182
             }
183 183
 
184 184
             $id = DB::table($this->data['table'])->insertGetId($data);
185 185
 
186
-            if(isset($this->data['hook_after_insert']) && is_callable($this->data['hook_after_insert'])) {
186
+            if (isset($this->data['hook_after_insert']) && is_callable($this->data['hook_after_insert'])) {
187 187
                 call_user_func($this->data['hook_after_insert'], $id);
188 188
             }
189 189
 
190 190
         } catch (CBValidationException $e) {
191 191
             Log::debug($e);
192
-            return cb()->redirectBack($e->getMessage(),'info');
192
+            return cb()->redirectBack($e->getMessage(), 'info');
193 193
         } catch (\Exception $e) {
194 194
             Log::error($e);
195
-            return cb()->redirectBack($e->getMessage(),'warning');
195
+            return cb()->redirectBack($e->getMessage(), 'warning');
196 196
         }
197 197
 
198 198
         if (request('submit') == trans('crudbooster.button_save_more')) {
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 
205 205
     public function getEdit($id)
206 206
     {
207
-        if(!module()->canUpdate()) return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area");
207
+        if (!module()->canUpdate()) return cb()->redirect(cb()->getAdminUrl(), "You do not have a privilege access to this area");
208 208
 
209 209
         $data = [];
210 210
         $data['row'] = $this->repository()->where($this->data['table'].'.'.getPrimaryKey($this->data['table']), $id)->first();
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 
216 216
     public function postEditSave($id)
217 217
     {
218
-        if(!module()->canUpdate()) return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area");
218
+        if (!module()->canUpdate()) return cb()->redirect(cb()->getAdminUrl(), "You do not have a privilege access to this area");
219 219
 
220 220
         try {
221 221
             $this->validation();
@@ -223,13 +223,13 @@  discard block
 block discarded – undo
223 223
             $data = columnSingleton()->getAssignmentData();
224 224
 
225 225
             //Clear data from Primary Key
226
-            unset($data[ cb()->pk($this->data['table']) ]);
226
+            unset($data[cb()->pk($this->data['table'])]);
227 227
 
228
-            if(Schema::hasColumn($this->data['table'], 'updated_at')) {
228
+            if (Schema::hasColumn($this->data['table'], 'updated_at')) {
229 229
                 $data['updated_at'] = date('Y-m-d H:i:s');
230 230
             }
231 231
 
232
-            if(isset($this->data['hook_before_update']) && is_callable($this->data['hook_before_update'])) {
232
+            if (isset($this->data['hook_before_update']) && is_callable($this->data['hook_before_update'])) {
233 233
                 $data = call_user_func($this->data['hook_before_update'], $id, $data);
234 234
             }
235 235
 
@@ -237,16 +237,16 @@  discard block
 block discarded – undo
237 237
                 ->where(cb()->pk($this->data['table']), $id)
238 238
                 ->update($data);
239 239
 
240
-            if(isset($this->data['hook_after_update']) && is_callable($this->data['hook_after_update'])) {
240
+            if (isset($this->data['hook_after_update']) && is_callable($this->data['hook_after_update'])) {
241 241
                 call_user_func($this->data['hook_after_update'], $id);
242 242
             }
243 243
 
244 244
         } catch (CBValidationException $e) {
245 245
             Log::debug($e);
246
-            return cb()->redirectBack($e->getMessage(),'info');
246
+            return cb()->redirectBack($e->getMessage(), 'info');
247 247
         } catch (\Exception $e) {
248 248
             Log::error($e);
249
-            return cb()->redirectBack($e->getMessage(),'warning');
249
+            return cb()->redirectBack($e->getMessage(), 'warning');
250 250
         }
251 251
 
252 252
 
@@ -259,15 +259,15 @@  discard block
 block discarded – undo
259 259
 
260 260
     public function getDelete($id)
261 261
     {
262
-        if(!module()->canDelete()) return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area");
262
+        if (!module()->canDelete()) return cb()->redirect(cb()->getAdminUrl(), "You do not have a privilege access to this area");
263 263
 
264
-        if(isset($this->data['hook_before_delete']) && is_callable($this->data['hook_before_delete'])) {
264
+        if (isset($this->data['hook_before_delete']) && is_callable($this->data['hook_before_delete'])) {
265 265
             call_user_func($this->data['hook_before_delete'], $id);
266 266
         }
267 267
 
268
-        $softDelete = isset($this->data['disable_soft_delete'])?$this->data['disable_soft_delete']:true;
268
+        $softDelete = isset($this->data['disable_soft_delete']) ? $this->data['disable_soft_delete'] : true;
269 269
 
270
-        if ($softDelete === true && Schema::hasColumn($this->data['table'],'deleted_at')) {
270
+        if ($softDelete === true && Schema::hasColumn($this->data['table'], 'deleted_at')) {
271 271
             DB::table($this->data['table'])
272 272
                 ->where(getPrimaryKey($this->data['table']), $id)
273 273
                 ->update(['deleted_at' => date('Y-m-d H:i:s')]);
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
                 ->delete();
278 278
         }
279 279
 
280
-        if(isset($this->data['hook_after_delete']) && is_callable($this->data['hook_after_delete'])) {
280
+        if (isset($this->data['hook_after_delete']) && is_callable($this->data['hook_after_delete'])) {
281 281
             call_user_func($this->data['hook_after_delete'], $id);
282 282
         }
283 283
 
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 
287 287
     public function getDetail($id)
288 288
     {
289
-        if(!module()->canRead()) return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area");
289
+        if (!module()->canRead()) return cb()->redirect(cb()->getAdminUrl(), "You do not have a privilege access to this area");
290 290
 
291 291
         $data = [];
292 292
         $data['row'] = $this->repository()->where($this->data['table'].'.'.getPrimaryKey($this->data['table']), $id)->first();
Please login to merge, or discard this patch.