Completed
Pull Request — develop (#115)
by Neil
03:06
created
app/Api/Controllers/General/ResourceController.php 2 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@
 block discarded – undo
27 27
 
28 28
 use App\Api\Controllers\Controller;
29 29
 use App\Models\General\IPv4;
30
+use App\Models\General\IPv4Mac;
30 31
 use App\Models\General\IPv6;
31 32
 use App\Models\Port;
32
-use App\Models\General\IPv4Mac;
33 33
 use Dingo\Api\Http;
34 34
 use Dingo\Api\Routing\Helpers;
35 35
 use Illuminate\Http\Request;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      */
48 48
     public function index(Request $request)
49 49
     {
50
-        return $this->response->array(array('statusText' => 'OK', 'resources' => ['ipv4','ipv6','arp','mac']));
50
+        return $this->response->array(array('statusText' => 'OK', 'resources' => ['ipv4', 'ipv6', 'arp', 'mac']));
51 51
     }
52 52
 
53 53
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         }
93 93
         elseif ($resource === "mac")
94 94
         {
95
-            return Port::select('port_id','ifPhysAddress')->paginate($per_page);
95
+            return Port::select('port_id', 'ifPhysAddress')->paginate($per_page);
96 96
         }
97 97
         elseif ($resource === "arp")
98 98
         {
Please login to merge, or discard this patch.
app/DataTables/General/SearchDataTable.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -223,6 +223,9 @@
 block discarded – undo
223 223
         ];
224 224
     }
225 225
 
226
+    /**
227
+     * @param string $type
228
+     */
226 229
     public function forType($type)
227 230
     {
228 231
         $this->type = $type;
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,12 +26,10 @@
 block discarded – undo
26 26
 namespace App\DataTables\General;
27 27
 
28 28
 use App\Models\General\IPv4;
29
-use App\Models\General\IPv6;
30 29
 use App\Models\General\IPv4Mac;
31
-use App\Models\Device;
30
+use App\Models\General\IPv6;
32 31
 use App\Models\Port;
33 32
 use Yajra\Datatables\Services\DataTable;
34
-use Illuminate\Http\Request;
35 33
 
36 34
 class SearchDataTable extends DataTable
37 35
 {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
                     $remote_hostname = empty($remote_device->port->device->hostname) ? trans('devices.text.deleted') : $remote_device->port->device->hostname;
77 77
                     return '<a href="'.url("devices/".$remote_id).'">'.$remote_hostname.'</a>';
78 78
                 })
79
-                ->addColumn('remote_interface',function($data) {
79
+                ->addColumn('remote_interface', function($data) {
80 80
                     $remote_device = IPv4::where('ipv4_addresses.ipv4_address', $data->ipv4_address)->with('port.device')->first();
81 81
                     $remote_id = empty($remote_device->port->device->device_id) ? '' : $remote_device->port->device->device_id;
82 82
                     $remote_port_id = empty($remote_device->port->port_id) ? '' : $remote_device->port->port_id;
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         ];
148 148
         if ($this->type === "ipv4")
149 149
         {
150
-            $cols = array_merge($cols,[
150
+            $cols = array_merge($cols, [
151 151
                 'ipv4_address' => [
152 152
                     'title'    => trans('general.text.address'),
153 153
                 ],
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         }
156 156
         if ($this->type === "ipv6")
157 157
         {
158
-            $cols = array_merge($cols,[
158
+            $cols = array_merge($cols, [
159 159
                 'ipv6_address' => [
160 160
                     'title'    => trans('general.text.address'),
161 161
                 ],
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         }
164 164
         if ($this->type === "mac")
165 165
         {
166
-            $cols = array_merge($cols,[
166
+            $cols = array_merge($cols, [
167 167
                 'ifPhysAddress' => [
168 168
                     'title'    => trans('general.text.mac_address'),
169 169
                 ],
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         }
172 172
         if ($this->type === "arp")
173 173
         {
174
-            $cols = array_merge($cols,[
174
+            $cols = array_merge($cols, [
175 175
                 'mac_address' => [
176 176
                     'title'   => trans('general.text.mac_address'),
177 177
                 ],
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         }
189 189
         if ($this->type !== "arp")
190 190
         {
191
-            $cols = array_merge($cols,[
191
+            $cols = array_merge($cols, [
192 192
                 'ifDescr'   => [
193 193
                     'title' => trans('general.text.port_descr'),
194 194
                 ],
Please login to merge, or discard this patch.
app/Http/Controllers/General/SearchController.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@
 block discarded – undo
23 23
  * @author     Neil Lathwood <[email protected]>
24 24
  */
25 25
 
26
- namespace App\Http\Controllers\General;
26
+    namespace App\Http\Controllers\General;
27 27
 
28
- use App\DataTables\General\SearchDataTable;
29
- use App\Http\Controllers\Controller;
30
- use Illuminate\Http\Request;
28
+    use App\DataTables\General\SearchDataTable;
29
+    use App\Http\Controllers\Controller;
30
+    use Illuminate\Http\Request;
31 31
 
32 32
 class SearchController extends Controller
33 33
 {
Please login to merge, or discard this patch.