Completed
Push — develop ( 30f8df...27a681 )
by Eliurkis
02:53
created
src/CrudController.php 3 patches
Doc Comments   +12 added lines patch added patch discarded remove patch
@@ -178,6 +178,9 @@  discard block
 block discarded – undo
178 178
 
179 179
     /* Private Actions */
180 180
 
181
+    /**
182
+     * @param Request $request
183
+     */
181 184
     protected function filters($entity, $request)
182 185
     {
183 186
         if ($request->query('filter')) {
@@ -219,6 +222,9 @@  discard block
 block discarded – undo
219 222
         }
220 223
     }
221 224
 
225
+    /**
226
+     * @param Request $request
227
+     */
222 228
     protected function paginate($entity, $request)
223 229
     {
224 230
         $rows = $entity->paginate($this->paginate);
@@ -236,6 +242,9 @@  discard block
 block discarded – undo
236 242
         return $rows;
237 243
     }
238 244
 
245
+    /**
246
+     * @param Request $request
247
+     */
239 248
     protected function search($entity, $request)
240 249
     {
241 250
         if ($request->get('q') != '') {
@@ -281,6 +290,9 @@  discard block
 block discarded – undo
281 290
         return $fields;
282 291
     }
283 292
 
293
+    /**
294
+     * @param Request $request
295
+     */
284 296
     protected function updateForeignRelations($row, $request)
285 297
     {
286 298
         $foreignRelations = $this->getForeignRelationsFields();
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 
117 117
     public function edit($id)
118 118
     {
119
-        if (! $this->entityInstance) {
119
+        if (!$this->entityInstance) {
120 120
             $this->entityInstance = $this->entity->findOrFail($id);
121 121
         }
122 122
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
         if ($request->get('q') != '') {
245 245
             $searchableCols = isset($this->searchable['columns']) ? $this->searchable['columns'] : $this->searchable;
246 246
 
247
-            $entity = $entity->where(function ($query) use ($request, $searchableCols) {
247
+            $entity = $entity->where(function($query) use ($request, $searchableCols) {
248 248
                 foreach ($searchableCols as $field) {
249 249
                     $query->orWhere($field, 'like', '%'.$request->get('q').'%');
250 250
                 }
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
         $links = ['index', 'create', 'store'];
315 315
 
316 316
         foreach ($links as $link) {
317
-            if (! isset($this->links[$link])) {
317
+            if (!isset($this->links[$link])) {
318 318
                 $this->links[$link] = route($this->route.'.'.$link);
319 319
             }
320 320
         }
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
         $config['cols'] = isset($config['cols']) ? $config['cols'] : 1;
349 349
 
350 350
         // Get foreign values
351
-        if (! count($config['options']) && isset($config['entity'])) {
351
+        if (!count($config['options']) && isset($config['entity'])) {
352 352
             $config['options'] = $config['entity']::get()
353 353
                 ->lists($config['field_value'], $config['field_key'])
354 354
                 ->toArray();
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
     protected function prepareField($name, $properties = [])
381 381
     {
382 382
         // Init
383
-        if (! $properties) {
383
+        if (!$properties) {
384 384
             $properties = $this->fields[$name];
385 385
         }
386 386
 
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 
398 398
         // Define field type class namespace
399 399
         $className = '\Eliurkis\Crud\FieldTypes\\'.ucfirst($properties['type']);
400
-        if (! class_exists($className)) {
400
+        if (!class_exists($className)) {
401 401
             return;
402 402
         }
403 403
 
Please login to merge, or discard this patch.
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,10 +2,10 @@
 block discarded – undo
2 2
 
3 3
 namespace Eliurkis\Crud;
4 4
 
5
-use DB;
6
-use Illuminate\Http\Request;
7 5
 use App\Http\Controllers\Controller;
6
+use DB;
8 7
 use Illuminate\Database\QueryException;
8
+use Illuminate\Http\Request;
9 9
 
10 10
 class CrudController extends Controller
11 11
 {
Please login to merge, or discard this patch.