@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | private function name($label, $name = null) |
| 20 | 20 | { |
| 21 | - return (!$name)?strtolower(slug($label,"_")):$name; |
|
| 21 | + return (!$name) ?strtolower(slug($label, "_")) : $name; |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | /** |
@@ -39,8 +39,8 @@ discard block |
||
| 39 | 39 | $model->setShowAdd(true); |
| 40 | 40 | $model->setShowEdit(true); |
| 41 | 41 | $model->setShowDetail(true); |
| 42 | - $model->setIndexDisplayTransform(function ($value, $row) { return $value; }); |
|
| 43 | - $model->setDetailDisplayTransform(function ($value, $row) { return $value; }); |
|
| 42 | + $model->setIndexDisplayTransform(function($value, $row) { return $value; }); |
|
| 43 | + $model->setDetailDisplayTransform(function($value, $row) { return $value; }); |
|
| 44 | 44 | return $model; |
| 45 | 45 | } |
| 46 | 46 | |
@@ -26,12 +26,12 @@ |
||
| 26 | 26 | |
| 27 | 27 | public function indexRender($row, $column) |
| 28 | 28 | { |
| 29 | - return (isset($row->{$column->getField()}))?$row->{ $column->getField() }:null; |
|
| 29 | + return (isset($row->{$column->getField()})) ? $row->{ $column->getField() }:null; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | public function detailRender($row, $column) |
| 33 | 33 | { |
| 34 | - return (isset($row->{$column->getField()}))?$row->{ $column->getField() }:null; |
|
| 34 | + return (isset($row->{$column->getField()})) ? $row->{ $column->getField() }:null; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -14,21 +14,21 @@ |
||
| 14 | 14 | { |
| 15 | 15 | public function postUploadImage() |
| 16 | 16 | { |
| 17 | - if(auth()->guest()) return redirect(cb()->getLoginUrl()); |
|
| 17 | + if (auth()->guest()) return redirect(cb()->getLoginUrl()); |
|
| 18 | 18 | |
| 19 | 19 | $file = null; |
| 20 | 20 | try { |
| 21 | 21 | |
| 22 | 22 | cb()->validation([ |
| 23 | - 'userfile' => 'required|mimes:' . implode(",",config('crudbooster.UPLOAD_IMAGE_EXTENSION_ALLOWED')) |
|
| 23 | + 'userfile' => 'required|mimes:'.implode(",", config('crudbooster.UPLOAD_IMAGE_EXTENSION_ALLOWED')) |
|
| 24 | 24 | ]); |
| 25 | 25 | |
| 26 | - $file = cb()->uploadFile('userfile', request("encrypt")?true:false, request("resize_width"), request("resize_height")); |
|
| 26 | + $file = cb()->uploadFile('userfile', request("encrypt") ?true:false, request("resize_width"), request("resize_height")); |
|
| 27 | 27 | |
| 28 | 28 | } catch (CBValidationException $e) { |
| 29 | - return response()->json(['status'=>false,'message'=>$e->getMessage()]); |
|
| 29 | + return response()->json(['status'=>false, 'message'=>$e->getMessage()]); |
|
| 30 | 30 | } catch (\Exception $e) { |
| 31 | - return response()->json(['status'=>false,'message'=>$e->getMessage()]); |
|
| 31 | + return response()->json(['status'=>false, 'message'=>$e->getMessage()]); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | return response()->json([ |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | public function getLogin() |
| 10 | 10 | { |
| 11 | - if(!auth()->guest()) return redirect(cb()->getAdminUrl()); |
|
| 11 | + if (!auth()->guest()) return redirect(cb()->getAdminUrl()); |
|
| 12 | 12 | |
| 13 | 13 | cbHook()->hookGetLogin(); |
| 14 | 14 | |
@@ -17,20 +17,20 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | public function postLogin() |
| 19 | 19 | { |
| 20 | - try{ |
|
| 20 | + try { |
|
| 21 | 21 | cb()->validation([ |
| 22 | 22 | 'email'=>'required|email', |
| 23 | 23 | 'password'=>'required' |
| 24 | 24 | ]); |
| 25 | - $credential = request()->only(['email','password']); |
|
| 25 | + $credential = request()->only(['email', 'password']); |
|
| 26 | 26 | if (auth()->attempt($credential)) { |
| 27 | 27 | cbHook()->hookPostLogin(); |
| 28 | 28 | return redirect(cb()->getAdminUrl()); |
| 29 | 29 | } else { |
| 30 | - return redirect(cb()->getLoginUrl())->with(['message'=>__('crudbooster.alert_password_wrong'),'message_type'=>'warning']); |
|
| 30 | + return redirect(cb()->getLoginUrl())->with(['message'=>__('crudbooster.alert_password_wrong'), 'message_type'=>'warning']); |
|
| 31 | 31 | } |
| 32 | - }catch (CBValidationException $e) { |
|
| 33 | - return cb()->redirect(cb()->getAdminUrl("login"),$e->getMessage(),'warning'); |
|
| 32 | + } catch (CBValidationException $e) { |
|
| 33 | + return cb()->redirect(cb()->getAdminUrl("login"), $e->getMessage(), 'warning'); |
|
| 34 | 34 | } |
| 35 | 35 | } |
| 36 | 36 | |
@@ -45,25 +45,25 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | public function postLoginDeveloper() { |
| 48 | - try{ |
|
| 48 | + try { |
|
| 49 | 49 | cb()->validation([ |
| 50 | 50 | 'username'=>'required', |
| 51 | 51 | 'password'=>'required' |
| 52 | 52 | ]); |
| 53 | 53 | |
| 54 | - if(request('username') == config('crudbooster.DEV_USERNAME') |
|
| 54 | + if (request('username') == config('crudbooster.DEV_USERNAME') |
|
| 55 | 55 | && request('password') == Cache::get("developer_password")) { |
| 56 | 56 | |
| 57 | 57 | session(['developer'=>1]); |
| 58 | 58 | |
| 59 | 59 | return redirect(cb()->getDeveloperUrl()); |
| 60 | 60 | |
| 61 | - }else{ |
|
| 61 | + } else { |
|
| 62 | 62 | return cb()->redirectBack("Username and or password is wrong!"); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - }catch (CBValidationException $e) { |
|
| 66 | - return cb()->redirect(cb()->getLoginUrl(),$e->getMessage(),'warning'); |
|
| 65 | + } catch (CBValidationException $e) { |
|
| 66 | + return cb()->redirect(cb()->getLoginUrl(), $e->getMessage(), 'warning'); |
|
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | if ($this->confirm('Do you have setting the database configuration at .env ?')) { |
| 41 | 41 | |
| 42 | - if (! file_exists(public_path('vendor')) ) { |
|
| 42 | + if (!file_exists(public_path('vendor'))) { |
|
| 43 | 43 | mkdir(public_path('vendor'), 0777); |
| 44 | 44 | } |
| 45 | 45 | |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | { |
| 172 | 172 | |
| 173 | 173 | $password = Str::random(16); |
| 174 | - cache()->forever("developer_password",$password); |
|
| 174 | + cache()->forever("developer_password", $password); |
|
| 175 | 175 | |
| 176 | 176 | $this->info('--'); |
| 177 | 177 | $this->info("DEVELOPER AREA"); |
@@ -41,12 +41,12 @@ discard block |
||
| 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 |
||
| 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); |
@@ -149,21 +149,21 @@ |
||
| 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) |
@@ -27,18 +27,18 @@ |
||
| 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 |
@@ -149,21 +149,21 @@ |
||
| 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) |