@@ -2,6 +2,6 @@ |
||
2 | 2 | if (!isset($uiframework) || $uiframework == 'bs3') { |
3 | 3 | $uiframework = 'bs4'; |
4 | 4 | } |
5 | -$adminIndex = 'crudapi::admin.' . $uiframework . '.index'; |
|
5 | +$adminIndex = 'crudapi::admin.'.$uiframework.'.index'; |
|
6 | 6 | ?> |
7 | 7 | @include($adminIndex) |
8 | 8 | \ No newline at end of file |
@@ -43,13 +43,13 @@ |
||
43 | 43 | var id = button.data('id'); |
44 | 44 | <?php |
45 | 45 | foreach ($fields as $field) { |
46 | - echo 'var ' . $field . ' = button.data(\'' . $field . '\');' . "\n"; |
|
46 | + echo 'var '.$field.' = button.data(\''.$field.'\');'."\n"; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | foreach ($fields as $field) { |
50 | 50 | $ucfield = ucfirst($field); |
51 | 51 | if ($apiHelper->fieldHelper->isIdField($field)) { |
52 | - echo "$('#editItem{$ucfield} option[value=' +{$field} +']').attr('selected', 'selected'); " . "\n"; |
|
52 | + echo "$('#editItem{$ucfield} option[value=' +{$field} +']').attr('selected', 'selected'); "."\n"; |
|
53 | 53 | } else { |
54 | 54 | echo "$('#editItem{$ucfield}').val({$field});\n"; |
55 | 55 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | data-id="{{ $r->id }}" |
7 | 7 | <?php |
8 | 8 | foreach ($fields as $f) { |
9 | - echo "data-{$f}=\"" . $r->$f . "\" "; |
|
9 | + echo "data-{$f}=\"".$r->$f."\" "; |
|
10 | 10 | } |
11 | 11 | ?> |
12 | 12 | data-target="#edit{{$trimmed_item}}Modal">Edit</button> |
13 | 13 | \ No newline at end of file |
@@ -11,7 +11,7 @@ |
||
11 | 11 | <table class="table"> |
12 | 12 | <?php |
13 | 13 | foreach ($fields as $field) { |
14 | - echo "<tr><td>{$field}</td><td><span id=\"deletedItem" . ucfirst($field) . "\"></span></td></tr>"; |
|
14 | + echo "<tr><td>{$field}</td><td><span id=\"deletedItem".ucfirst($field)."\"></span></td></tr>"; |
|
15 | 15 | } |
16 | 16 | ?> |
17 | 17 | </table> |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | "_token": "{{ csrf_token() }}" |
25 | 25 | } |
26 | 26 | |
27 | - $('#<?php echo $modal_id;?>').modal('hide'); |
|
27 | + $('#<?php echo $modal_id; ?>').modal('hide'); |
|
28 | 28 | |
29 | 29 | /* Send the post request */ |
30 | 30 | @if(isset($done)) |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | } |
41 | 41 | </script> |
42 | 42 | <script> |
43 | - $('#<?php echo $modal_id;?>').on('show.bs.modal', function (event) { |
|
43 | + $('#<?php echo $modal_id; ?>').on('show.bs.modal', function (event) { |
|
44 | 44 | var button = $(event.relatedTarget) // Button that triggered the modal |
45 | 45 | |
46 | 46 | var id = button.data('id'); |
47 | 47 | <?php |
48 | 48 | foreach ($fields as $field) { |
49 | - echo 'var ' . $field . ' = button.data(\'' . $field . '\')' . "\n"; |
|
49 | + echo 'var '.$field.' = button.data(\''.$field.'\')'."\n"; |
|
50 | 50 | } ?> |
51 | 51 | |
52 | 52 | //var recipient = button.data('whatever') // Extract info from data-* attributes |
@@ -6,7 +6,7 @@ |
||
6 | 6 | data-id="{{ $r->id }}" |
7 | 7 | <?php |
8 | 8 | foreach ($fields as $f) { |
9 | - echo "data-{$f}=\"" . $r->$f . "\" "; |
|
9 | + echo "data-{$f}=\"".$r->$f."\" "; |
|
10 | 10 | } |
11 | 11 | ?> |
12 | 12 | data-target="#delete{{$trimmed_item}}Modal">Delete</button> |
13 | 13 | \ No newline at end of file |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | $fqModel = $crudApi->getModel(); |
29 | 29 | |
30 | - $this->assertEquals($namespace . 'User', $fqModel); |
|
30 | + $this->assertEquals($namespace.'User', $fqModel); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | public function testUserGetModelCanBeInstantiated() |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | $item = new Post(); |
22 | 22 | |
23 | - $config = require __DIR__ . '/../../config/crudapi.php'; |
|
23 | + $config = require __DIR__.'/../../config/crudapi.php'; |
|
24 | 24 | |
25 | 25 | $primary_field = $fieldHelper->getPrimaryField($item, $config); |
26 | 26 |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | Route::group( |
4 | - ['namespace' => 'Taskforcedev\CrudApi\Http\Controllers'], function () { |
|
4 | + ['namespace' => 'Taskforcedev\CrudApi\Http\Controllers'], function() { |
|
5 | 5 | Route::group( |
6 | - ['middleware' => ['web'], 'prefix' => 'admin/'], function () { |
|
6 | + ['middleware' => ['web'], 'prefix' => 'admin/'], function() { |
|
7 | 7 | Route::post('create/{model}', ['as' => 'crudapi.create.item', 'uses' => 'AdminController@store']); |
8 | 8 | Route::patch('update/{model}', ['as' => 'crudapi.update.item', 'uses' => 'AdminController@update']); |
9 | 9 | Route::delete('delete/{model}', ['as' => 'crudapi.delete.item', 'uses' => 'AdminController@delete']); |