We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -4,12 +4,9 @@ |
||
4 | 4 | use Illuminate\Routing\Controller as BaseController; |
5 | 5 | use Illuminate\Foundation\Validation\ValidatesRequests; |
6 | 6 | use Illuminate\Http\Request; |
7 | -use Crypt; |
|
8 | -use Illuminate\Support\Facades\Form as Form; |
|
9 | 7 | use Alert; |
10 | 8 | |
11 | 9 | // VALIDATION: change the requests to match your own file names if you need form validation |
12 | -use Backpack\CRUD\app\Http\Requests\CrudRequest as StoreRequest; |
|
13 | 10 | use Backpack\CRUD\app\Http\Requests\CrudRequest as UpdateRequest; |
14 | 11 | |
15 | 12 | class CrudController extends BaseController { |
@@ -58,8 +58,7 @@ discard block |
||
58 | 58 | if (property_exists($model, 'translatable')) |
59 | 59 | { |
60 | 60 | $this->data['entries'] = $model::where('translation_lang', \Lang::locale())->get(); |
61 | - } |
|
62 | - else |
|
61 | + } else |
|
63 | 62 | { |
64 | 63 | $this->data['entries'] = $model::all(); |
65 | 64 | } |
@@ -286,8 +285,7 @@ discard block |
||
286 | 285 | $this->data['entries'] = $model::where('translation_lang', $lang)->get(); |
287 | 286 | $this->data['languages'] = \Backpack\LangFileManager\app\Models\Language::all(); |
288 | 287 | $this->data['active_language'] = $lang; |
289 | - } |
|
290 | - else |
|
288 | + } else |
|
291 | 289 | { |
292 | 290 | $this->data['entries'] = $model::all(); |
293 | 291 | } |
@@ -330,8 +328,7 @@ discard block |
||
330 | 328 | $count++; |
331 | 329 | } |
332 | 330 | } |
333 | - } |
|
334 | - else |
|
331 | + } else |
|
335 | 332 | { |
336 | 333 | return false; |
337 | 334 | } |
@@ -388,8 +385,7 @@ discard block |
||
388 | 385 | if ($existing_translation) |
389 | 386 | { |
390 | 387 | $new_entry = $existing_translation; |
391 | - } |
|
392 | - else |
|
388 | + } else |
|
393 | 389 | { |
394 | 390 | // get the info for that entry |
395 | 391 | $new_entry_attributes = $this->data['entry']->getAttributes(); |
@@ -437,8 +433,7 @@ discard block |
||
437 | 433 | if(!in_array($this->crud['fields'][$k]['store_in'], $fake_field_columns_to_encode, true)){ |
438 | 434 | array_push($fake_field_columns_to_encode, $this->crud['fields'][$k]['store_in']); |
439 | 435 | } |
440 | - } |
|
441 | - else //otherwise in the one defined in the $crud variable |
|
436 | + } else //otherwise in the one defined in the $crud variable |
|
442 | 437 | { |
443 | 438 | $request['extras'][$this->crud['fields'][$k]['name']] = $request[$this->crud['fields'][$k]['name']]; |
444 | 439 | |
@@ -482,8 +477,7 @@ discard block |
||
482 | 477 | if(!in_array($this->crud['fields'][$k]['store_in'], $fake_field_columns_to_encode, true)){ |
483 | 478 | array_push($fake_field_columns_to_encode, $this->crud['fields'][$k]['store_in']); |
484 | 479 | } |
485 | - } |
|
486 | - else //otherwise in the one defined in the $crud variable |
|
480 | + } else //otherwise in the one defined in the $crud variable |
|
487 | 481 | { |
488 | 482 | if(!in_array('extras', $fake_field_columns_to_encode, true)){ |
489 | 483 | array_push($fake_field_columns_to_encode, 'extras'); |
@@ -543,8 +537,7 @@ discard block |
||
543 | 537 | if (isset($this->crud['create_fields'])) |
544 | 538 | { |
545 | 539 | $this->crud['fields'] = $this->crud['create_fields']; |
546 | - } |
|
547 | - elseif (isset($this->crud['update_fields'])) |
|
540 | + } elseif (isset($this->crud['update_fields'])) |
|
548 | 541 | { |
549 | 542 | $this->crud['fields'] = $this->crud['update_fields']; |
550 | 543 | } |
@@ -576,8 +569,9 @@ discard block |
||
576 | 569 | |
577 | 570 | // if no field type is defined, assume the "text" field type |
578 | 571 | foreach ($this->crud['fields'] as $k => $field) { |
579 | - if (!isset($this->crud['fields'][$k]['type'])) |
|
580 | - $this->crud['fields'][$k]['type'] = 'text'; |
|
572 | + if (!isset($this->crud['fields'][$k]['type'])) { |
|
573 | + $this->crud['fields'][$k]['type'] = 'text'; |
|
574 | + } |
|
581 | 575 | } |
582 | 576 | |
583 | 577 | // if an entry was passed, we're preparing for the update form, not create |
@@ -2,7 +2,6 @@ |
||
2 | 2 | namespace Backpack\CRUD; |
3 | 3 | |
4 | 4 | use Illuminate\Support\ServiceProvider; |
5 | -use Illuminate\Routing\Router; |
|
6 | 5 | use Route; |
7 | 6 | |
8 | 7 | class CrudServiceProvider extends ServiceProvider |
@@ -1,6 +1,5 @@ |
||
1 | 1 | <?php namespace Backpack\CRUD; |
2 | 2 | |
3 | -use Illuminate\Database\Eloquent\Model; |
|
4 | 3 | use DB; |
5 | 4 | use Lang; |
6 | 5 |
@@ -77,8 +77,7 @@ |
||
77 | 77 | if (!count($columns)) { |
78 | 78 | if (property_exists($model, 'fakeColumns')) { |
79 | 79 | $columns = $this->fakeColumns; |
80 | - } |
|
81 | - else |
|
80 | + } else |
|
82 | 81 | { |
83 | 82 | $columns = ['extras']; |
84 | 83 | } |
@@ -71,8 +71,7 @@ |
||
71 | 71 | if ($results && $results->count()) { |
72 | 72 | $results_array = $results->lists($column['attribute'], 'id'); |
73 | 73 | echo implode(', ', $results_array->toArray()); |
74 | - } |
|
75 | - else |
|
74 | + } else |
|
76 | 75 | { |
77 | 76 | echo '-'; |
78 | 77 | } |
@@ -37,8 +37,7 @@ |
||
37 | 37 | if ($results && $results->count()) { |
38 | 38 | $results_array = $results->lists($column['attribute'], 'id'); |
39 | 39 | echo implode(', ', $results_array->toArray()); |
40 | - } |
|
41 | - else |
|
40 | + } else |
|
42 | 41 | { |
43 | 42 | echo '-'; |
44 | 43 | } |